Tuesday, January 5, 2010

Reconnecting VMhost after losing connections due to config problems

In trying to figure out our VMware setup, configure the switches and virtual switches many times I ended up losing connectivity to the vmhosts. The majority of the time this was caused by moving the vmnics into and out of the different switches or switch groups.

When ever this occurs the only way I have found to correct it is by going to the host console, for us this is accomplished via the remote console. When using the remote console I have found the following commands to be a great deal of help.

Many of these were taken from various VM sites including here, here or here.

To view the current configuration you can use
esxcfg-vswitch -l
which will create an output like.
For a virtual switch you can use commands like
esxcfg-vswitch -U {$vmnicid#} {$virtualSwitchName} this will remove or unlink the vmnic from the switch.

To link or add a vmnic to a virtual switch use the command
esxcfg-vswitch -L {$vmnicid#} {$virtualSwitchName}

To link or add a vmnic to a Distributed virtual switch or DVP use the command
esxcfg-vswitch -P {$vmnicid#} -V {$dvportId} {$dvswitchName}

To unlink or remove a vmnic from a Distributed virtual switch or DVP use the command
esxcfg-vswitch -Q {$vmnicid#} -V {$dvportId} {$dvswitchName}

No comments:

Post a Comment