PDA

View Full Version : [other] Cloned JeOS vmware vm does not have eth0


wjfang
November 13th, 2008, 08:02 AM
I created in VMware server 2.0 a virtual machine using Ubuntu JeOS 8.04.1. I then installed open ssh server, ... everything is fine.

The problem came when I tried to clone the virtual machine. I used the conventional way: copy the file (vmdk, vmx), add the new vm into invertory. When asked the question if I copied it or moved it, I answered I copied it. Then the cloned vm is able to start up. But, there is no eth0 and the route table is empty. It does have an eth1 which has the MAC address stated in the vmx file but has no ip address associated with. Unsurprisingly I do not have TCP/TP support in the cloned vm.

Does anyone have the same experience? How to solve it? Many thanks in advance!

Cheers,

Weijian

oneloveamaru
November 13th, 2008, 11:17 AM
That's because the udev file is still holding the other eth0 and it's MAC address in there. Go to /etc/udev/rules.d/ and something like persistent-net.rules file, can't remember the number. You'll see something like this...

# PCI device 0x14e4:0x164c (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:b9:b2:9a:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x14e4:0x164c (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:b9:b2:9a:03", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


The first two lines are the first NIC card is picked up from the old VM. Delete those and then change the last lines so it says eth0. So the file looks like this now..

# PCI device 0x14e4:0x164c (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:b9:b2:9a:03", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

You will probably need a reboot.

What I usually do is just delete all the lines and the reboot. It will add the only NIC card in the system back in but the way I gave you will work too.

wjfang
November 13th, 2008, 11:32 AM
Thanks! it works!

do you think this is a bug in udev? In the beginning of /etc/udev/rules.d/70-persistent-net.rules, it says "this file was automatically generated by the /lib/udev/write_net_rules ..."

Can udev detect the old network card is gone, so it deletes the obsolete action?

Cheers,

Weijian

oneloveamaru
November 13th, 2008, 11:35 AM
It's not a bug. That is how it's supposed to work. It detects a new ethernet device and assigns it ethX accordingly based on a MAC address. How many times does someone need to switch NIC cards completely out of a system? It doesn't happen much for me, only happens with when I clone VM's like you or when a motherboard goes bad in a server, which has only happened once with my 30+ servers.