Remove generated network rules on instance import
authorGuido Trotter <ultrotter@google.com>
Fri, 11 Jan 2008 12:07:52 +0000 (12:07 +0000)
committerGuido Trotter <ultrotter@google.com>
Fri, 11 Jan 2008 12:07:52 +0000 (12:07 +0000)
udev generates rules to maintain the order of the network interfaces stable.
When importing an instance, though, its mac address may change, and networking
be broken. This patch removes the generated network rules file, making udev
create a new one after the first boot of an imported instance. This issue was
first spotted by Gunnar Wagenknecht.

Reviewed-by: iustinp

import

diff --git a/import b/import
index 83bfc39..2803756 100755 (executable)
--- a/import
+++ b/import
@@ -50,7 +50,7 @@ TMPDIR=`mktemp -d` || exit 1
 trap "umount $TMPDIR; rmdir $TMPDIR" EXIT
 mount $blockdev $TMPDIR
 ( cd $TMPDIR; restore -r -y -f - )
-
+rm -f $TMPDIR/etc/udev/rules.d/z25_persistent-net.rules
 umount $TMPDIR
 rmdir $TMPDIR
 trap - EXIT