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

Fri Nov 25 11:11:44 UTC 2011
Matija Draganović <mdra137 at gmail.com>

Finally, I managed to solve the problem. The problem was rather strange -
after configuring bridges I added new ifaces to the VM. For some reason,
during boot process of the VM's, wrong interface was started (VM tried to
bring up eth2 instead eth1?).

After adding the new ifaces through virt-manager, the VM started regulary
and created a new network script for eth2
(/etc/sysconfig/network-scripts/ifcfg-eth2). I think that the problem was
this - when the VM is restarted it tried to bring up eth2 while vif-script
tried to propagate second bridge via eth1 iface. I resolved this simply by
replacing ifcfg-eth2 script with ifcfg-eth1. Now, VM starts/restarts
regulary ;)

So, the process for creating and configuring new bridges that I follow is
(tried on multiple servers):

- create new script that sets up multiple bridges in /etc/xen/scripts/

example: network-xen-multi-bridge

#!/bin/sh
# network-xen-multi-bridge
# Exit if anything goes wrong.
set -e
# First arg is the operation.
OP=$1
shift
script=/etc/xen/scripts/network-bridge.xen
case ${OP} in
start)
        $script start vifnum=3 bridge=xenbr3 netdev=eth3
        $script start vifnum=0 bridge=xenbr0 netdev=eth0
        ;;
stop)
        $script stop vifnum=3 bridge=xenbr3 netdev=eth3
        $script stop vifnum=0 bridge=xenbr0 netdev=eth0
        ;;
status)
        $script status vifnum=3 bridge=xenbr3 netdev=eth3
        $script status vifnum=0 bridge=xenbr0 netdev=eth0
        ;;
*)
        echo 'Unknown command: ' ${OP}
        echo 'Valid commands are: start, stop, status'
        exit 1
esac



- make it executable (chmod 755 network-xen-multi-bridge)

- configure /etc/xen/xend-config.sxp (comment out the current script and
add the new one);

# It is possible to use the network-bridge script in more complicated
# scenarios, such as having two outgoing interfaces, with two bridges, and
# two fake interfaces per guest domain.  To do things like this, write
# yourself a wrapper script, and call network-bridge from it, as appropriate.
#
#(network-script network-bridge)
(network-script  network-xen-multi-bridge)



- restart physical server so the bridges are properly created

- add virt. ifaces to the VM's (via virt-manager or via config. files in
/etc/xen/ ..)

- boot VM

- configure newly added iface in /etc/sysconfig/network-scripts/

- restart VM

Additionaly I check everything by restarting phys. server to make sure that
everything is ok ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20111125/1304c71b/attachment-0003.html>