The Real (and Virtual) Adventures of Nathan the IT Guy

Oct 30 2009   4:44AM GMT

vSwitch and vSwif Problems

Nathan Simon Nathan Simon Profile: Nathan Simon

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:

esxcfg-vswif -l

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:

esxcfg-vswitch -l

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:

cat /etc/sysconfig/network

NETWORKING=yes
GATEWAYDEV=vswif0
HOSTNAME=host.domain.com
GATEWAY=nnn.nnn.nnn.nnn

9.Run the following commands to list all of the network adapters and associate a vmnic which has a link status of up:

esxcfg-nics -l
esxcfg-vswitch -L vmnic1 vSwitch0

10.Run the following command to verify that the vmnic is associated with the vSwitch:

esxcfg-vswitch -l

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…

Good Luck

-NS

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: