xentaur
view xendomain.py @ 38:f71b298798c2
real topologies
author | igor |
---|---|
date | Fri Sep 28 13:03:15 2007 +0300 (2007-09-28) |
parents | 244f1602496a |
children | 10444acb35f4 |
line source
1 ####
2 #
3 # External variables:
4 # * network
5 # * domain
8 try:
9 domain
10 except NameError:
11 import sys
12 network=sys.modules['__main__'].network
13 domain=sys.modules['__main__'].domain
15 import os
16 sys.path.append(os.environ['HOME']+"/xentaur")
17 os.environ['xendomain']=domain
19 #try:
21 exec 'from %s import *' % (network)
22 #except:
23 # print "Can't find or interpret module %s with topology description" %(network)
24 # sys.exit(1)
27 N = str(domains.index(domain))
28 name=domain
30 pae=1
31 if pae:
32 kernel = "/boot/vmlinuz-2.6.18-5-xen-686"
33 ramdisk = "/boot/initrd.img-2.6.18-5-xen-686"
34 else:
35 kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686"
36 ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU"
38 #builder='linux'
39 cpu_cap = 10
42 vbridges = vbridges_table[name]
44 vif=[]
45 x=1
46 for i in vbridges:
47 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
48 x+=1
50 disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+N+'.img,hda3,w' ]
51 root = "/dev/hda1 ro"
53 xenomips='/xenomips/ios/'+ios_name+' -t '+npe_type+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
55 for i in range(len(vbridges)-1):
56 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
58 for i in range(len(vbridges)):
59 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
61 if domain_types[int(N)] == 'quagga':
62 extra = "quagga"
63 else:
64 extra = "xenomips=\""+xenomips+"\""
66 on_poweroff = 'destroy'
67 on_reboot = 'restart'
68 on_crash = 'restart'