eth0 not present after libvirt clone

With the release of Fedora 13, I have a new target OS for software. In order to deal with the vagaries of installs, I have come to the pattern of creating one VM per target OS, which I get to the starting point, and then clone that for any actual work.

I recently created a minimal F13 VM.  I booted it, and then brought up the network.

This is a minimal install, as I said, which means that it does not have an X install, nor any of the Graphic utilities. In Fedora systems, networking is performed via Network Manager, a User level graphical tool. In order to bring up the network, I was using the “Old School” command

ifup eth0

When I cloned it, and then tried to bring up eth0 from the command line, I got the error message “eth0 does not seem to be present”.

On  Red Hat style systems like RHEL and Fedora, ifup eth0 gets its config info from

/etc/sysconfig/network-scripts/ifcfg-eth0

However, there is a new twist: dev – dynamic device management.  The udev subsystem, when I first booted the “clean” or prototype F13 installed VM, recorded the mac address in:

/etc/udev/rules.d/70-persistent-net.rules

Specifically, the line looks something like this:

# Networking Interface (rule written by anaconda)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:aa:bb:00:dd:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

When I cloned the machine, the clone got a new mac address for the network interface.  Looking in dmesg, I saw a message that eth0 has been renamed to eth1.  When I looked into the rules file above, I saw a second line, with NAME=”eth1″.

When I cloned the machine, the clone process did not know about the subsystem in /etc/sysconfig/network-scripts, so there was not ifcfg-eth1 file created, and thus no networking for the clone.

The solution was to delete the first line, and to change the second line to NAME=”eth0″ and then reboot the machine.  In order to make sure that it has network enabled, I also ran

chkconfig network on

Which should re-enable the old style networking on reboot.

Update:
If you have done old style networking already, make sure you commend out the mac address in

/etc/sysconfing/network-script/ifup-eth0

Or change it to the new one, or the init.d script will not bring up the interface.