Hacking .vmx files to change the virtual PCI slot for a NIC

It’s possible to change the virtual PCI port that a virtual NIC uses.

This allows a tester to simulate using host profiles with differing hardware, and in this case, it’s possible to use host profiles even if the PCI bus trees are slightly different

eg, in the .vmx file for VM1

ethernet0.pciSlotNumber = “32”
ethernet1.pciSlotNumber = “34”
ethernet2.pciSlotNumber = “35”
ethernet3.pciSlotNumber = “36”
ethernet4.pciSlotNumber = “37”
ethernet5.pciSlotNumber = “38”

leads to:

~ # lspci | grep -i vmnic
000:002:00.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic0]
000:002:02.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic1]
000:002:03.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic2]
000:002:04.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic3]
000:002:05.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic4]
000:002:06.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic5]

 

But if we change the PCI slot for VM2, we get a slightly different result:

ethernet0.pciSlotNumber = “32”
ethernet1.pciSlotNumber = “34”
ethernet2.pciSlotNumber = “35”
ethernet3.pciSlotNumber = “36”
ethernet4.pciSlotNumber = “37”
ethernet5.pciSlotNumber = “39”

which gives:

~ # lspci | grep -i vmnic
000:002:00.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic0]
000:002:02.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic1]
000:002:03.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic2]
000:002:04.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic3]
000:002:05.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic4]
000:002:07.0 Network controller: Intel Corporation PRO/1000 MT Single Port Adapter [vmnic5]

 

2:07 = (2*16 + 7 == 39)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: