What happens when you cannot connect to the service console anymore, and even if you had a backup service console and it wasn’t working either, well i happened to me. When I attempted to attach a vmnic to a vSwitch, I got an error message, no matter what I tried I could not get it reconnected. Last ditch effort is to recreate the vswif interface. Below are the steps I took. I had to do the first 4 steps twice, as i had to vSwitches.
Note: On your system the vswif, vmnic, vSwitch numbers and network settings are different.
1.Run the following command to list the name of the vswif adapter:
2.Run the following command to delete the vswif adapter:
esxcfg-vswif –del vswif0
3.Run the following command to list the name of the vSwitch:
4.Run the following command to delete the vSwitch:
esxcfg-vswitch -d vSwitch0
5.Run the following command to create the vSwitch:
esxcfg-vswitch -a vSwitch0
6.Run the following commands to create default port groups for vSwitch:
esxcfg-vswitch -A “VM Network” vSwitch0
esxcfg-vswitch -A “Service Console” vSwitch0
7.Run the following command to create the vswif adapter:
esxcfg-vswif –add –portgroup “Service Console” –ip=nnn.nnn.nnn.nnn –netmask=255.255.255.0 vswif0
8.Run the following command to verify that the settings in the network file are correct:
9.Run the following commands to list all of the network adapters and associate a vmnic which has a link status of up:
esxcfg-vswitch -L vmnic1 vSwitch0
10.Run the following command to verify that the vmnic is associated with the vSwitch:
11.Ping an IP address to check for network connectivity. If the ping fails remove the previous vmnic from the vSwitch and try another adapter that has a link status of up.
12.Once you have verified connectivity, you can then connect to Virtual Infrastructure client of the affected ESX Server, you may or may not have a bit a work ahead of you at this point, depending on iSCSI, etc…