After upgrading from ESXi 5.0 to 5.1, I was presented with a curious “change has been detected” message during VM startup. It asked whether the VM had been recently “Moved” or “Copied”. I was leaning towards “Moved”, except for the fact that it also said “when in doubt, select ‘Copied'”. Big mistake picking ‘Copied’.

When “Copied” is selected, VMware creates new device IDs to be associated with your VM, such as the MAC addresses of the virtualized VMnics. But in the case of CentOS Linux, ‘eth0′ was already known by the previous MAC and managed with /etc/sysconfig/network-scripts/ifcfg-eth0. And CentOS does not forget. A new eth1 device was created in the kernel, but there was no pre-existing ifcfg-eth1 startup script. So the end result is no networking support, save for loopback.

I could have created an ifcfg-eth1 to match the new device and been done with it, but I wanted my eth0 back. Adding HWADDR= to ifcfg in an attempt to override the MAC doesn’t work because of the mismatch at the driver level. The solution was to edit

and delete the old eth0 device entry, renaming eth1 in the process. Alternatively, you can delete the file entirely and it will be recreated at reboot when it iterates through all available devices.

Presumably the same solution would come into play if you replaced the NIC in a physical CentOS/RHEL machine as well…