We are using Cisco UCS servers where we can programmatically setup the vNICs on the hardware which would then be available as vmnics in ESXi.
We have a number of servers which were setup and are connected to vSwitch0 for management (2x UCS vNICs as uplinks) and the dvSwitch (another 2x UCS vNICs). Servers are ESXi 7.0u3g.
We have modified the vNIC placement in UCS Intersight so that all derived servers from this one template will have the vNICs in a specific order. Thus vNIC0 will be discovered by ESXi first and will become vmnic0, then vNIC1 will become vmnic1, etc. For new servers this is OK because when ESXi is installed, it will discover the vNICs and give them the correct and corresponding vmnics.
However for existing servers, where the vNICs have already been given vmnic labels by ESXi, after changing the Cisco vNIC order and re-applying it to the physical ESXi server, the vmnics are now connected to the wrong dvSwitches.
This is what an existing server's networking looks like:
Cisco vNIC Name | Cisco Placement order | ESXi vmnic Label | dvSwitch |
vnic-cms-mgt-a | Auto | vmnic2 | vSwitch0 |
vnic-cms-mgt-b | Auto | vmnic3 | vSwitch0 |
vnic-cms-esxi-a | Auto | vmnic0 | dvResource |
vnic-cms-esxi-b | Auto | vmnic1 | dvResource |
When I changed the vNIC placement in Intersight to manual so that I could put specific vNICs with specific vmnics, I get this on the server:
Cisco vNIC Name | Cisco Placement order | ESXi vmnic Label | dvSwitch |
vnic-cms-mgt-a | 0 | vmnic0 | dvResource |
vnic-cms-mgt-b | 1 | vmnic1 | dvResource |
vnic-cms-esxi-a | 2 | vmnic2 | vSwitch0 |
vnic-cms-esxi-b | 3 | vmnic3 | vSwitch0 |
One way to re-arrange the vmnics on an existing ESXi install is to re-install ESXi overwriting the local disk- bit much!
The other way is to manually re-arrange the vmnic labels (https://kb.vmware.com/s/article/2091560)- bit much!
My question is, can I instruct ESXi to do a rediscovery of the physical vNICs and based on the placement order of the vNICs, replace the vmnic labels with the correct ones.