The Virtualization Room

A SearchServerVirtualization.com and SearchVMware.com blog

» VIEW ALL POSTS Feb 6 2008   1:04PM GMT

Fixing the network in Dom-Us for Ubuntu hosts running Xen



Posted by: Akutz
Tags:
Andrew Kutz
Virtualization
Xen

I ran into problem recently where the network would not come up in a Dom-U after the initial domain creation. All subsequent reboots would result in an unprivileged domain without network connectivity. Here is an example of the error that would occur if I attempted to restart the network manually:

root@odin:~# /etc/init.d/networking restart
* Reconfiguring network interfaces...
eth0: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

So what is going on? Well, it turns out that udev was binding the domain’s NIC to the initial MAC address of the vswif (which changes on reboot by default). Hence when the domain comes online for a second (and third, and so forth) time with a new MAC address, the domain does not recognize the NIC.

The solution is quite simple: edit the udev rules that bind NICs to MAC addresses. In Ubuntu this is in two places. You need to edit “/etc/udev/rules.d/70-persistent-net.rules” and comment out any lines that look like this:

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:16:3e:2b:2e:7b", NAME="eth0"

And because the aforementioned file is automatically generated, you also need to edit “/etc/udev/rules.d/75-persistent-net-generator.rules” and comment out any lines that look like this:

SUBSYSTEMS=="xen", ENV{COMMENT}="Xen virtual device"

I also commented out the following line for good measure:

ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*|ath*|wlan*|ra*|sta*" NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"

This will prevent *any* generation. Anyway, once you make these changes and restart the Dom-U, the network will come up every time without a hitch.

Hope this helps!

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: