So to put it quite bluntly I am no vSphere master. Give me a network DMZ design and let me loose. Enterprise network edge? Ace. BGP? No worries. I am learning my doing (see breaking) my lab in Singapore at the moment.
The Situation
When you configure a Distributed Virtual Switch under vCenter there is configuration stored on vCenter and the vSphere host. Well I destroyed my vCenter and decided I would seize the vSphere host under a new vCenter. Problem was that the vNIC0 was still associated to an orphaned DVS.
vNIC0 was attached to Mgt_DVS_ which caused a few headaches. This wouldn’t normally be an issue as I have more than one NIC uplinked to a network but this environment is nested on OpenStack.
After enabling MAC learning on the OVS and removing the Neutron Security Group I jumped into the vSphere CLI.
The command esxcfg-vswitch -l
[[email protected]:~] esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 1536 4 128 1500 vmnic2 PortGroup Name VLAN ID Used Ports Uplinks VM Network 0 0 vmnic2 Management Network 0 1 vmnic2 DVS Name Num Ports Used Ports Configured Ports MTU Uplinks Mgt_DVS 1536 4 512 1500 vmnic0 DVPort ID In Use Client 8 1 vmnic0
I need to free the vmNIC0 from the DVS. The command required for this:
esxcfg-vswitch -Q vmnic0 -V 8 Mgt_DVS
This command will identify vmnic0 with the DVPort ID of 8 on the Mgt_DVS and remove it. I will confirm this once more.
[[email protected]:~] esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 1536 4 128 1500 vmnic2 PortGroup Name VLAN ID Used Ports Uplinks VM Network 0 0 vmnic2 Management Network 0 1 vmnic2 DVS Name Num Ports Used Ports Configured Ports MTU Uplinks Mgt_DVS 1536 1 512 1500 DVPort ID In Use Client 8 0 7 0
Now that the vNIC is removed from the DVS I can reuse it where I desire.
Learning by doing
Whilst there is all the information out there you don’t learn as quickly or as efficiently as when you break something yourself. Troubleshooting is a great way of find out what went wrong, how to fix it, and to see what your actions impact.