Thursday, August 8, 2019

Change vmnic order on vSphere 6.x

This is an article by Marco van Baggun at that explains how to change vmnic order on vSphere 6.x

Here you can check how to do it for previous versions.

There is always one ESXi host who thinks he’s special and therefore has a different configuration than its siblings. This week it was a brand spanking new UCS blade server that didn’t want to play nice and the result was a different vmnic order.

I’ve done this fix several times before with the older versions (< v5.5) of vSphere but now it was vSphere 6.0 so the KB article 2019871 that describes how to do this up to version 5.1 did not apply any more. But all the way at the bottom there is a link to KB article 2091560 that describe how to do this with vSphere 6.x!

How to change the vmnic order

Log on to your “special” ESXi host with your favorite SSH client.

Run the following command to see the current assignment of aliases to device locations:

localcli --plugin-dir /usr/lib/vmware/esxcli/int/ deviceInternal alias list

The output will look as follows:

Bus type Bus address Alias
pci s00000000:03.00 vmnic0
pci s00000000:04.00 vmnic1
pci s0000000f:06.00 vmhba1
pci s0000000f:05.00 vmnic5
pci s00000000:05.00 vmnic2
pci s00000000:06.00 vmhba0
pci s0000000f:03.00 vmnic3
pci s0000000f:04.00 vmnic4

Then to reassign an alias run the following command:

localcli --plugin-dir /usr/lib/vmware/esxcli/int/ deviceInternal alias store --bus-type pci --alias vmnicN --bus-address B

For example, if you want to swap vmnic3 and vmnic4 use the following commands:

localcli --plugin-dir /usr/lib/vmware/esxcli/int/ deviceInternal alias store --bus-type pci --alias vmnic3 --bus-address s0000000f:04.00
localcli --plugin-dir /usr/lib/vmware/esxcli/int/ deviceInternal alias store --bus-type pci --alias vmnic4 --bus-address s0000000f:03.00

After you re-assigned the aliases perform a clean reboot of the ESXi host and you’re done!

No comments:

Post a Comment