In order to have 3 identical nodes for my MariaDB Galera cluster, I cloned a hyper-v install of CentOS6 and after firing up the clone and trying to start networking received the error: “device eth0 does not seem to be present, delaying initialization”
We need to get the list of current eth devices:
1 2 |
# ls /sys/class/net eth1 lo |
It turns out that the NIC on the cloned machine was being renamed and registered as eth1.
There is a device manager, udev, which stores the settings from the NIC of the vm prior to the cloning process. When you clone a vm hypervisor changes the mac address of the NIC and as a result the vm sees it as a new NIC and assigns it to /dev/eth1.
To fix this we now have to edit the udev config file as well as the ifcfg-eth0 file to get the newly update virtual NIC card to operate on the eth0 device.
First, edit: /etc/udev/rules.d/70-persistent-net.rules
1 2 3 4 5 6 7 8 9 10 11 |
# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. # net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:0a:27:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:0a:27:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" |
Delete the first SUBSYSTEM entry in the file.
Update the ‘eth1’ attribute in the remaining entry to ‘eth0’
Edit /etc/sysconfig/network-scripts/ifcfg-eth0 : change the HWADDR to match the new MAC address listed in the newly edited 70-persistent-net.rules file.
Reboot the server.