2011年10月13日 星期四

esx4.1 service console 重新設定


重新建立你的VSwif0介面











分享








很多人可能會誤砍VSwif0介面,導致不能用VI Client登入管理ESX Server. 或是網路忽然失效

所以學起來也不賴,可以救急.

以下方式重建你的
Service Console 需到ESX Server Console畫面前面開始以下步驟 :



1.建立新vswitchesxcfg-vswitch -a vSwitch0

2.建立新的portgroupesxcfg-vswitch -p "Service Console" vSwitch0 3. 3.分配網
esxcfg-vswitch –L vmnic0 vSwitch0 4. 4.分配vswif 介面並設定IPesxcfg-vswif –a vswif0 -p "Service Console" i 192.168.2.102 –n 255.255.255.0




Rebuilding your Service Console network


We had been having issues installing in a new ESX farm on a c7000 chassis, due to the lack of a Routing Switch (we will not go into the reasons as to its absence, the pain is still too sharp), so when it finally arrived we had to change the IP addressing scheme on the installed servers and guests to collapse the current flat network that utilised a 16 bit sub-net into a network that utilised a 24 bit sub-net mask. what follows below is a blow by blow account of the command line battle. It was a glorious war :D


So how exactly do you do this from the command line, well firstly you have to delete your vswif and if configured your vmknic interfaces by using the following commands


設定網卡


esxcfg-vswif -d vswif0

esxcfg-vmknic -d vmkernel   Substitute your vmkernel name here.


Also remember that ESX is a case sensitive Operating system: VMKernel is different from vmkernel.   Once that is done you need to delete your port groups


esxcfg-vswitch -D “VMKernel”

esxcfg-vswitch -D “Service Console”


The Quotes are not necessary unless you have spaces in your port group names so it is better to get used to using them. Finally delete your vSwitches


esxcfg-vswitch -d vSwitch0


This will now leave you with a ‘blank’ networking config. next run the reset options for each of the following commands:


esxcfg-vswitch -r

esxcfg-vmknic -r

esxcfg-vswif0 -r


and finally verify if everything has actually gone use


esxcfg-vswitch -l

esxcfg-vmknic -l

esxcfg-vswif -l


Now you need to recreate your switches and portgroups


First issue the following command to create the vswitches


esxcfg-vswitch -a vSwitch0

esxcfg-vswitch -a vSwitch1


Next create your port groups


esxcfg-vswitch -A “Service Console” vSwitch0

esxcfg-vswitch -A “VMKernel” vSwitch0

esxcfg-vswitch -A “ProdNet” vSwitch1




If this all works with no issues, if you have issued the commands correctly then you should have no issues. Issue the command esxcfg-vswitch -l to see what it looks like.


Next recreate the vswif interface


esxcfg-vswif -a vswif0 -p “Service Console” -i <your IP Address here> -n <Your Subnet Mask here>


Now recreate the vmkernel interface


esxcfg-vmknic -a “VMKernel” -i <your IP Address here> -n <Your Subnet Mask here>


Run esxcfg-vswitch -l to verify your vswitch config.

Lastly, associate uplinks to your vSwitches


esxcfg-vswitch -L vmnic0 vSwitch0

esxcfg-vswitch -L vmnic1 vSwitch1


If you have more than one nic assigned to each vSwitch then reissue the above command with the required vmnic#


there is one further set of commands to add, if you are using multiple Portgroups per vSwitch you will need to assign a VLAN id to it.


esxcfg-vswitch -v <VLAN ID> <PortGroupName> vSwitch#


This is quite a complicated set of commands to work through, but well worth the time spent, the above commands are the basic building blocks of a nice #Bash script I will be showing you late



2011年10月12日 星期三

[ FreeBSD ] FreeNAS Rsync to Operate (Pull/Push)



rsync 是一套非常棒的 OpenSource 檔案備份同步軟體,因為 rsync 在備份資料時有方向性(Pull/Push),因此將此測試做個簡單的記錄以方便未來使用,過程是在兩台FreeNAS (Server/Client) 下操作,備份方式直接使用 SSH 連進 Client 端那台機器下 command 操作,FreeNAS 為 FreeBSD 所打包的嵌入式 NAS 系統因此基本操作都跟 FreeBSD 一樣。為何不用 FreeNAS WebGUI 上直接設定 rsync ?因為小弟在使用 FreeNAS 的 WebGUI 設定 rsync 時上遇到權限上的備份問題,且 WebGUI 對方向性(Pull/Push)的設定沒那麼彈性,因此我的用戶端才改為 command 操作,待測試 Ok 便可寫個 shell script 加入 crontab 就可用定時去同步備份。



環境:



B (192.168.1.1) Server 端

使用 WebGUI 開啟Port 873 的 rsync 服務,同時分享出名稱為 office 的備份目錄。

A (192.168.1.2) Client 端

用 SSH 直接連進機器使用 commnad line 操作。



操作方式:



A 機器上操作( 將 A 機器上要備份的 /mnt/office/main 目錄檔案送到 B 機器的 office 分享資料夾中)。



# rsync -avzrtopg --delete-after /mnt/office/main 192.168.1.1::office



A 機器上操作( 將 B 機器上分享的 office 檔案夾取回到 A 機器的 /mnt/office/main 分享資料夾中)。



# rsync -avzrtopg --delete-after 192.168.1.1::office /mnt/office/main/



下 command 的基本原則。



# rsync (參數) (Source來源端) (Destination目的端)



參數說明:



* -a, –archive archive mode,檔案模式。

* -v, –verbose increase verbosity,觀看過程。

* -z, –compress compress file data,壓縮資料。

* -P, – equivalent to –partial –progress,顯示程序進度%。

* -delete , –delete files that don't exist on the sending side (參數 -after 表示完成同步後再刪除),保持二台機器資料的一致性。



Ref.


http://www.samba.org/ftp/rsync/rsync.html




Mac 上寫 blog

現在開始用離線軟體寫一些工作上的筆記