分享
很多人可能會誤砍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
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 “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
This will now leave you with a ‘blank’ networking config. next run the reset options for each of the following commands:
esxcfg-vmknic -r
esxcfg-vswif0 -r
and finally verify if everything has actually gone use
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 vSwitch1
Next create your port groups
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
Now recreate the vmkernel interface
Run esxcfg-vswitch -l to verify your vswitch config.
Lastly, associate uplinks to your vSwitches
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.
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