I have 300+ VMs of ubuntu build on from one ova. On vm there are 5 network adapters. I need from inside vm rename them regarding to VMware ESX order.
For example naming in different scenarios:
- first = eth1, second = eth2, third = em0, etc
- first = em0, second = em9, third = br0, etc
- first = phys1, second = phys2, third = eth0, etc.
My problem is that lspci|grep "Ethernet controller" don't show them ordered:
04:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
0c:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
13:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
1b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
04:00.0 should be eth1 but it's eth4 -- I compared by macs
it's really order: /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:0b:00.0", ATTR{dev_id}=="0x0", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:13:00.0", ATTR{dev_id}=="0x0", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:1b:00.0", ATTR{dev_id}=="0x0", NAME="eth3"
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:04:00.0", ATTR{dev_id}=="0x0", NAME="eth4"
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:0c:00.0", ATTR{dev_id}=="0x0", NAME="eth5"
This is information from ubuntu vm on ESXi:
cat ubuntu.vmx|grep eth|more
ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.networkName = "_clients_network_1"
ethernet0.addressType = "vpx"
ethernet1.present = "TRUE"
ethernet1.virtualDev = "vmxnet3"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.networkName = "_servers_network_1"
ethernet1.addressType = "vpx"
ethernet2.present = "TRUE"
ethernet2.virtualDev = "vmxnet3"
ethernet2.wakeOnPcktRcv = "FALSE"
ethernet2.networkName = "_clients_network_1"
ethernet2.addressType = "vpx"
ethernet3.present = "TRUE"
ethernet3.virtualDev = "vmxnet3"
ethernet3.wakeOnPcktRcv = "FALSE"
ethernet3.networkName = "_servers_network_1"
ethernet3.addressType = "vpx"
ethernet4.present = "TRUE"
ethernet4.virtualDev = "vmxnet3"
ethernet4.wakeOnPcktRcv = "FALSE"
ethernet4.networkName = "VM Network"
ethernet4.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:a8:66:24"
ethernet0.pciSlotNumber = "192"
ethernet1.generatedAddress = "00:50:56:a8:32:78"
ethernet1.pciSlotNumber = "224"
ethernet2.generatedAddress = "00:50:56:a8:7e:2c"
ethernet2.pciSlotNumber = "256"
ethernet3.generatedAddress = "00:50:56:a8:56:91"
ethernet3.pciSlotNumber = "1184"
ethernet4.generatedAddress = "00:50:56:a8:67:ad"
ethernet4.pciSlotNumber = "1216"
ethernet0.generatedAddressOffset = "0"
ethernet1.generatedAddressOffset = "10"
ethernet2.generatedAddressOffset = "20"
ethernet3.generatedAddressOffset = "30"
ethernet4.generatedAddressOffset = "40"