xentaur

view examples/fabergeN @ 17:6d2b4b61733f

messages
author igor
date Thu Sep 20 16:34:22 2007 +0300 (2007-09-20)
parents
children aa20b6252730
line source
1 try:
2 from xenomips_vars import N
3 except:
4 print "can't find xenomips_vars module"
6 pae=1
8 if pae:
9 kernel = "/boot/vmlinuz-2.6.18-4-xen-686"
10 ramdisk = "/boot/initrd.img-2.6.18-4-xen-686"
11 else:
12 kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686"
13 ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU"
15 #builder='linux'
16 cpu_cap = 10
19 ############################################################################################
20 # Topology description
22 network='change-default-route'
24 domains = [ 'dyn1', 'dyn2', 'dyn3', 'qua4', 'qua5', 'qua6', 'qua7', 'qua8', 'qua9', ]
25 domain_types = [ 'xenomips', 'xenomips', 'xenomips', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', ]
26 bridges = [
27 'vlan100',
28 'vlan101',
29 'vlan102',
30 'vlan103',
31 'vlan104',
32 'vlan105',
33 'vlan106',
34 'vlan107',
35 'vlan108',
36 'vlan109',
37 'vlan110',
38 'vlan111',
39 ]
41 vbridges_table ={
42 'dyn1' : [ 'vlan101', 'vlan102' ],
43 'dyn2' : [ 'vlan101', 'vlan103' ],
44 'dyn3' : [ 'vlan102', 'vlan103', 'vlan104' ],
46 'qua4' : [ 'vlan105', 'vlan106', 'vlan111' ],
47 'qua5' : [ 'vlan110', 'vlan111' ],
48 'qua6' : [ 'vlan109', 'vlan110' ],
49 'qua7' : [ 'vlan108', 'vlan109' ],
50 'qua8' : [ 'vlan107', 'vlan108' ],
51 'qua9' : [ 'vlan106', 'vlan107' ],
52 }
54 hidden_bridges = []
55 broken_links = []
56 temporary_links = []
58 ############################################################################################
60 if domain_types[int(N)] == 'quagga':
61 memory = 64
62 else:
63 memory = 400
65 xenomips_dir='/xen/images/'
66 ios_name='C7200-JK.BIN'
68 #this instance configuration
69 name = domains[int(N)]
71 vbridges = vbridges_table[name]
73 vif=[]
74 x=1
75 for i in vbridges:
76 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
77 x+=1
79 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' ]
80 root = "/dev/hda1 ro"
82 xenomips='/xenomips/ios/'+ios_name+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
84 #for i in range(len(vbridges)-2):
85 # xenomips += ' -p '+str(i+1)+':PA-FE-TX'
86 #
87 #for i in range(len(vbridges)-1):
88 # xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i+1)
90 for i in range(len(vbridges)-1):
91 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
93 for i in range(len(vbridges)):
94 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
97 if domain_types[int(N)] == 'quagga':
98 extra = "quagga"
99 else:
100 extra = "xenomips=\""+xenomips+"\""
102 on_poweroff = 'destroy'
103 on_reboot = 'restart'
104 on_crash = 'restart'