A Xen network setup you can actually understand

The default Xen network setup is, in my opinion, really confusing. Moreover, it is built by a script that is prone to fail in complex situations. For example, the part that handles bonds doesn’t seem to work properly on Squeeze.

If you do not believe that the default setup is complicated, just look at that. I’m not sure why it does things in such a complicated way, just so that your bridge takes the name of the former physical interface. The end result is that people not familiar with Xen (just like me a few month ago) will scratch their head before realizing eth0 is NOT a network interface but a bridge !

Today I wanted to setup Xen on top of a bonded interface. The scripts failed, and I resolved to stop using them. My approach is to use what comes with your distribution. The main advantage is that it is WAY easier to understand what is being done. Here is a snippet /etc/network/interfaces that builds a bridge suitable for Xen on top of a bonded link made of eth0 and eth1 :

iface eth0 inet manual
iface eth1 inet manual

auto bond0
iface bond0 inet manual
slaves        eth0 eth1
bond-mode    active-backup
bond_miimon    100
bond_downdelay    200
bond_updelay    200

auto xenbr
iface xenbr inet static
bridge_ports    bond0
address       1.2.3.4
netmask        255.255.255.0
gateway        1.2.3.5

No more worries. My xen network-script now just creates Vlan bridges over bond0 (it is scripted because the vlan list is computed, but I could do it just like that in Puppet).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s