xentaur
view xendomain.py @ 35:244f1602496a
config splitted to several modules
author | igor |
---|---|
date | Tue Sep 25 22:16:24 2007 +0300 (2007-09-25) |
parents | dd8c79bc715c |
children | 7bf7abe92123 |
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 #sys.path.append('/home/igor/xentaur')
16 #try:
18 exec 'from %s import *' % (network)
19 #except:
20 # print "Can't find or interpret module %s with topology description" %(network)
21 # sys.exit(1)
24 N = str(domains.index(domain))
25 name=domain
27 pae=1
28 if pae:
29 kernel = "/boot/vmlinuz-2.6.18-4-xen-686"
30 ramdisk = "/boot/initrd.img-2.6.18-4-xen-686"
31 else:
32 kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686"
33 ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU"
35 #builder='linux'
36 cpu_cap = 10
39 vbridges = vbridges_table[name]
41 vif=[]
42 x=1
43 for i in vbridges:
44 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
45 x+=1
47 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' ]
48 root = "/dev/hda1 ro"
50 xenomips='/xenomips/ios/'+ios_name+' -t '+npe_type+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
52 for i in range(len(vbridges)-1):
53 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
55 for i in range(len(vbridges)):
56 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
58 if domain_types[int(N)] == 'quagga':
59 extra = "quagga"
60 else:
61 extra = "xenomips=\""+xenomips+"\""
63 on_poweroff = 'destroy'
64 on_reboot = 'restart'
65 on_crash = 'restart'