martes, 16 de abril de 2013

Network Interface(s) after Linux P2V or V2V conversion | Interface de red de sistemas Linux después de una conversión P2V o V2V

When I started to migrate the systems I manage from a Xenserver environment to a VMWare environment I noticed that all the Linux systems were not able to connect to the network unless I destroyed and recreate the Interface, same happened when importing OVA or OVF templates. Finally I manage to squeeze some time and research about this issue and find a post on Alex Cline's blog where he explains why this happens and also present a more elegant solution rather than my primitive "search & destroy). Below I will summarize the solution, please refer to Alex Cline blog to read the full explanation and details.

When trying to bring up Network Interface the following message appears:

Bringing up interface eth0: Device eth0 does not seem to be preset, delaying initialization.      [FAILED]

To fix this, open /etc/udev/rules.d/70-persistent-net.rules. with your favorite text editor you will see something like this:

# 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. # PCI device 0x8086:0x100f (e1000) (custom name provided by external tool)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:16", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) (custom name provided by external tool)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"



Take note of the MAC Address (HW Address) assigned by VMWare to the virtual interface and editudev's rules accordingly, for example, assume the virtual interface MAC Address is 00:50:56:9c:00:18, you will need it to edit rules so you end with something like this:

# 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.# PCI device 0x8086:0x100f (e1000) (custom name provided by external tool)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x8086:0x100f (e1000) (custom name provided by external tool)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

basically you have to delete unused network interface(s) rules and rename the one that has the current MAC Address.Finally, you need to validate MAC Address in /etc/sysconfig/network-scripts/ifcfg-eth0 to avoid , remember the MAC Address is the value of HWADDRESS.