[CentOS-virt] XEN multiple bridge problem - VM won' start!

Fri Nov 18 14:33:35 UTC 2011
Peter Peltonen <peter.peltonen at gmail.com>


2011/11/18 Matija Draganović <mdra137 at gmail.com>:
> I've been using CentOS & Xen on a server that has 2 VM's configured. The
> default configuration includes one physical iface that is propagated (by a
> default bridge) to the VM's.

You do not mention which version of CentOS and Xen you are using?

> Since I wanted to configure additional physical iface, define a new bridge
> and propagate it to the viface-s of the VM's, i configured the bridge/phys.
> iface and brought it up (here are configurations that I set up):
> -> eth3
> DEVICE=eth3
> BOOTPROTO=static
> HWADDR=D4:85:64:4B:76:AB
> ONBOOT=yes
> #DHCP_HOSTNAME=kdr-3k-4r-3o-07
> BRIDGE=br0
> TYPE=Ethernet
> -> br0
> DEVICE=br0
> TYPE=Bridge
> ONBOOT=yes

If this is a CentOS5 machine with the CentOS provided Xen 3.0
packages, then here is info how i got my bridges to work with that

* For dom0 I configured eth0 and eth1 as usual in /etc/sysconfig/network-scripts

* I did not configure br0 or br1 in network-scripts, but instead I
created a file called /etc/xen/scripts/my-network-script having this

dir=$(dirname "$0")
"$dir/network-bridge" "$@" vifnum=0 netdev=eth0 bridge=xenbr0
"$dir/network-bridge" "$@" vifnum=1 netdev=eth1 bridge=xenbr1

* Then I modified in dom0 the file /etc/xen/xend-config.sxp in the
following way:

#(network-script network-bridge)
(network-script my-network-script)

* Now rebooting dom0 made the bridges available

* After that I could configure them in my domU config:

vif = [ "mac=00:16:3E:69:29:25,bridge=xenbr0,script=vif-bridge","mac=00:16:3E:E6:B0:6D,bridge=xenbr1,script=vif-bridge"

* After starting the domU I could configure the interfaces in
network-scripts using the hardware addresses specified in the domU

It seems that configuring bridging is done a bit differently in
different Xen versions, so this might not work if you are using some
other kind of config. With CentOS6 and 3rd party Xen 4.1 packages this
procedure did not work at all and instead I needed to do the

* in dom0 create the br0 and br1 devices in network-scripts

* in dom0 /etc/xen/xend-config.sxp put instead:

#(network-script network-bridge)
(network-script /bin/true)

* and in dom0 use different configuration for the domU config files like this:

vif = [ "mac=00:16:3E:69:29:25,bridge=br0","mac=00:16:3E:E6:B0:6D,bridge=br1" ]

Hope this helps, unfortuantely I am not familiar with virsh at all.