Network interfaces names changed in KVM guest cloned with virt-clone

Bug #345234 reported by Andres Rodriguez
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Nominated for Lucid by Mark Deneen

Bug Description

Binary package hint: kvm

I used virt-clone to clone KVM guests. The hosts uses KVM 72 in Intrepid Ibex, and the Guests are Hardy Heron. After cloning, the machine works perfectly, everything gets cloned the way it should, but the network interface names are changed. ie. form eth0 to eth3.

The question is how can I change the network interfaces back to its original name.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Btw... I try to bring up networking with: sudo ifup eth0.

Changed in kvm:
status: New → Invalid
assignee: nobody → andreserl
assignee: andreserl → nobody
status: Invalid → New
description: updated
Changed in kvm:
status: New → Invalid
Revision history for this message
Lennart Karssen (l.c.karssen) wrote :

I'm experiencing the same thing here. The host runs Ubuntu 9.10 server, the guest as well.
I think this bug results from the fact that virt-clone changes the MAC address of the quest. If I remember correctly debian-based distributions change the name of a network interface if they detect a new MAC address.

Changed in kvm (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Lennart Karssen (l.c.karssen) wrote :

I found this thread on the Ubuntu forums that also discusses this problem (in combination with VMware, but that's beside the point, since this happens whenever an ubuntu/debian system is cloned):

There are several solutions to this bug:
- Simply delete /etc/udev/rules.d/70-persistent-net.rules either before or after the cloning, or edit the file after cloning.
- Remove execute permissions from /lib//udev/write_net_rules, but that results in an error on startup
- Edit /lib/udev/rules.d/75-persistent-net-generator.rules so that it ignores MAC addresses from VMware or KVM. For Xen such a line already exists:
# ignore Xen virtual interfaces
SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"

From the forum post above, add the following for VMware
# ignore VMware network interfaces identified by vendor part of MAC addr
ENV{MATCHADDR}=="00:0c:29:*", GOTO="persistent_net_generator_end"

For KVM and virt-clone I added these:
# ignore KVM virtual interfaces
ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
# This eems to be the range used by Xen, but also by virt-clone
ENV{MATCHADDR}=="00:16:36:*", GOTO="persistent_net_generator_end"

Make sure these lines are after the following lines:
# read MAC address

This worked for me.

Revision history for this message
Lennart Karssen (l.c.karssen) wrote :

I consider this to be a bug, since only Xen devices seem to be taken care of, but KVM/Qemu devices aren't. A fix for this is mentioned in the comments.

affects: kvm (Ubuntu) → udev (Ubuntu)
Changed in udev (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.