Tuesday, March 27, 2007

Xen and eth device renaming

Recently I rebooted one of my Debian Xen servers and suddenly all the Ethernet devices which used to be eth0 in the domU's became eth1.

vif = [ '', 'bridge=xenbr1' ]

I used to have the above as the interface definition and for domU's that had only a single interface that worked well (if there is only one interface then it should be eth0). However in a recent etch update this changed, so I had to use ifrename as documented in my previous blog post. It's annoying when things break because a reasonable assumption which previously worked suddenly stops working.

Even if the bug in question (if it is regarded as a bug) is fixed I'll keep using ifrename, it doesn't do any harm.


Vincent Bernat said...

You can also remove /etc/udev/rules.d/*persistent-net*

vaclav ovsik said...

and maybe fixate MAC address (choose some) in vif definition.

Markus Hochholdinger said...

Debian etch remembers network interfaces by their MAC-address.
If no MAC-address is given in the config file, xen chooses a random MAC-address each time the domU ist restartet, so etch thinks this is a new card (udev).

So use somthing like:
vif = [ "mac=00:16:3E:12:34:56, bridge=xenbr0" ]

00:16:3E:XX:XX:XX are reserved for xen and can freely be used.

etbe said...

True, I can use mac=, and I now do.

However I think it's reasonable to assume that such things should just work.

xenoterracide said...

I'm playing with xen at home and had this problem thanks for the tip. I was looking for how to do it because I knew it was possible.

to add to the tip. In gentoo might be a different file in other linux's you can go into /etc/udev/rules.d/70-persistant-net.rules and remove all the devices xen got created for you. you should also be able to see the mac's and rename the device name there.

Andrew said...

Thanks for writing this up. I just got bitten by it, and I could vaguely remember reading it previously, and managed to find it again with Google.