xentaur

diff xentaur.py @ 42:e006fac33f05

dynamips platform
author igor
date Wed Oct 24 13:27:53 2007 +0300 (2007-10-24)
parents 10444acb35f4
children 85794a582ef5
line diff
     1.1 --- a/xentaur.py	Fri Oct 12 17:31:34 2007 +0300
     1.2 +++ b/xentaur.py	Wed Oct 24 13:27:53 2007 +0300
     1.3 @@ -8,7 +8,7 @@
     1.4  sys.path.append('/etc/xen')
     1.5  sys.path.append(xentaur_path)
     1.6  
     1.7 -network='snrs_ipsec_preshared_1'
     1.8 +network='snrs_ipsec_rsa_1'
     1.9  domain='qua1'
    1.10  from xendomain import *
    1.11  
    1.12 @@ -38,8 +38,9 @@
    1.13  
    1.14  def create_bridges_script():
    1.15      unbound_bridges=set(bridges)-set(real_bridges)
    1.16 -    create_unbound_bridges="\n".join(map(lambda x: "sudo /usr/sbin/brctl show | awk '{print $1}' | grep -qx "+x+" || sudo /usr/sbin/brctl addbr "+x, unbound_bridges))
    1.17 -    create_unbound_bridges+="\n"+"\n".join(map(lambda x: "sudo /bin/ip link set "+x+" up", unbound_bridges))
    1.18 +    create_unbound_bridges="\n".join(map(lambda x: "sudo brctl show | awk '{print $1}' | grep -qx "+x+" || sudo brctl addbr "+x, unbound_bridges))
    1.19 +    create_unbound_bridges+="\n"+"\n".join(map(lambda x: "sudo brctl stp "+x+" off", unbound_bridges))
    1.20 +    create_unbound_bridges+="\n"+"\n".join(map(lambda x: "sudo ip link set "+x+" up", unbound_bridges))
    1.21  
    1.22      print """#!/bin/sh
    1.23  # create unbound bridges
    1.24 @@ -50,12 +51,12 @@
    1.25  def create_domains_script():
    1.26      for domain in domains:
    1.27          if not domain in real_nodes:
    1.28 -            print "sudo /usr/sbin/xm create "+xentaur_path+"/xendomain.py "+" domain="+domain+" network="+network+" && sleep 1 && sudo /usr/sbin/xm sched-credit -d $(sudo /usr/sbin/xm list | grep "+domain+" | awk '{print $2}') -c 10 && sleep 1"
    1.29 +            print "sudo xm create "+xentaur_path+"/xendomain.py "+" domain="+domain+" network="+network+" && sleep 1 && sudo xm sched-credit -d $(sudo xm list | grep "+domain+" | awk '{print $2}') -c 10 && sleep 1"
    1.30  
    1.31  def destroy_domains_script():
    1.32      for domain in domains:
    1.33          if not domain in real_nodes:
    1.34 -            print "sudo /usr/sbin/xm shutdown "+domain
    1.35 +            print "sudo xm shutdown "+domain
    1.36  
    1.37  def create_screens_script():
    1.38      N=1