ESXi Physical NIC Labels

If you are a Windows user, and someone that builds systems, you may have noticed strange behavior when adding/removing network cards.  If you have two network cards in your machine and one goes bad, you replace it.  Even though you still have two network cards in your machine, the network connections applet may list “Local Area Connection 0” and “Local Area Connection 2.”  Wait a second, what happened to “Local Area Connection 1?”  Windows stores these items in the registry in case you put the peripheral back in, so the next new device will count up.  This can be confusing and skew standard configurations in an enterprise.  Deleting registry entries of stale connections will get you back to that standard configuration.

Where am I going with this?  ESXi does the same thing.  If you have two physical NICs they are labeled vmnic0 and vmnic1.  If you replace vmnic1 with another NIC, or upgrade the firmware, your host will show vmnic0 and vmnic2 when it is booted.  Like Windows, there is a place where this configuration is stored; /etc/vmware/esx.conf. 

Here are the steps to change the ordering:

1. SSH into your vmhost

2. Type vi /etc/vmware/esx.conf

3. Find all instances of the vmnic you want to change

4. Press the key “A” (this will put the file in append mode)

5. Make your changes

image

6. Press the ESC key and type :wq!

7.  Press enter and reboot your ESXi host.

When your host comes back up ensure physical adapter to vSwitch/vDS bindings are correct.

Comments 2

  1. on a serious note though… if you went as far as i did and configured all the port groups and such even though the nic number was off, then you have quite a few entries to change in the esx.conf file. in my scenario, i had 3 nics totalling 12 ports. and on my affected hosts, my nic/port assignment looked like:

    nic1: 0/1/2/3
    nic2: 4/5/8/9
    nic3: 10/11/12/13

    so i had to fix every single one of the nics in the file from nic8 up to nic13. i did this starting at nic8 and using unix find/replace and ran these command inside of my vi session on the esx.conf file:

    :%s/vmnic8/vmnic6/
    :%s/vmnic9/vmnic7/
    :%s/vmnic10/vmnic8/
    :%s/vmnic11/vmnic9/
    :%s/vmnic12/vmnic10/
    :%s/vmnic13/vmnic11/

    saved me a lot of manual edits…

Leave a Reply

Your email address will not be published. Required fields are marked *

*