# HG changeset patch # User root@linux10 # Date 1223670946 0 # Node ID 748e008905796465871a8d362cbd4a960450d909 # Parent 21f21fa8f1067f72c10dceb16f90c343241f257c transition to xen 3.2.1 diff -r 21f21fa8f106 -r 748e00890579 xen-drbd-install.py --- a/xen-drbd-install.py Fri Oct 10 18:43:08 2008 +0000 +++ b/xen-drbd-install.py Fri Oct 10 20:35:46 2008 +0000 @@ -19,7 +19,7 @@ Options: --help (-h) -- show usage information - --network=name (-n) -- the network descriptions is in the file name.py (default: network.py) + --network=name (-n) -- the network descriptions is in the file name (default: network) """ @@ -364,24 +364,33 @@ def make_bridges(): ip=get_management_ip() gw=get_default_gateway() - print "ifconfig %s 0.0.0.0 down" % (trunk) + trunk_bridge=trunk + # tagged interfaces for bridge in bridges: vlan=vlans[bridges.index(bridge)] if vlan == 'tagged': - print "/etc/xen/scripts/network-bridge-for-xen-drbd start vifnum=%s bridge=%s netdev=%s" % (bridges.index(bridge)+2,bridge,trunk) - print "ip link set %s up" % (trunk) + if trunk_bridge != trunk: + print "\n=====\nERROR: No more than one tagged bridge allowed.\nYou have defined the tagged bridge already, %s " % trunk_bridge + sys.exit(1) + trunk_bridge=bridge + print "ifconfig %s 0.0.0.0 down" % (trunk) + print "/etc/xen/scripts/network-bridge start vifnum=%s bridge=%s netdev=%s" % (bridges.index(bridge)+2,bridge,trunk) + print "ip link set %s up" % (trunk_bridge) + + if trunk_bridge==trunk: + print "ifconfig %s up" % (trunk) # untagged interfaces for bridge in bridges: vlan=vlans[bridges.index(bridge)] if vlan != 'tagged': - print "vconfig add %s %s" % (trunk,vlan) - print "/etc/xen/scripts/network-bridge-for-xen-drbd start vifnum=%s bridge=%s netdev=%s.%s" % (bridges.index(bridge)+2,bridge,trunk,vlan) - print "ip link set %s.%s up" % (trunk,vlan) + print "vconfig add %s %s" % (trunk_bridge,vlan) + print "/etc/xen/scripts/network-bridge start vifnum=%s bridge=%s netdev=%s.%s" % (bridges.index(bridge)+2,bridge,trunk_bridge,vlan) + print "ip link set %s up" % (bridge) - print "ifconfig %s.%s %s netmask %s" % (trunk,management_vlan,management_ip,management_netmask) + print "ifconfig %s %s netmask %s" % (management_interface,management_ip,management_netmask) if management_gw: print "route add default gw %s" % (management_gw)