xentaur

view examples/fabergeN @ 22:c4a092e32ee1

bridge up and down
author igor
date Fri Sep 21 13:16:28 2007 +0300 (2007-09-21)
parents 360ec7b5616c
children
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
21 #
22 #
24 network='change-default-route'
26 domains = [ 'dyn1', 'dyn2', 'dyn3', 'qua4', 'qua5', 'qua6', 'qua7', 'qua8', 'qua9', ]
27 domain_types = [ 'xenomips', 'xenomips', 'xenomips', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', ]
28 bridges = [
29 'vlan100',
30 'vlan101',
31 'vlan102',
32 'vlan103',
33 'vlan104',
34 'vlan105',
35 'vlan106',
36 'vlan107',
37 'vlan108',
38 'vlan109',
39 'vlan110',
40 'vlan111',
41 ]
43 vbridges_table ={
44 'dyn1' : [ 'vlan101', 'vlan102' ],
45 'dyn2' : [ 'vlan101', 'vlan103' ],
46 'dyn3' : [ 'vlan102', 'vlan103', 'vlan104' ],
48 'qua4' : [ 'vlan105', 'vlan106', 'vlan111' ],
49 'qua5' : [ 'vlan110', 'vlan111' ],
50 'qua6' : [ 'vlan109', 'vlan110' ],
51 'qua7' : [ 'vlan108', 'vlan109' ],
52 'qua8' : [ 'vlan107', 'vlan108' ],
53 'qua9' : [ 'vlan106', 'vlan107' ],
54 }
56 hidden_bridges = []
57 broken_links = []
58 temporary_links = []
60 ############################################################################################
62 if domain_types[int(N)] == 'quagga':
63 memory = 64
64 else:
65 memory = 400
67 xenomips_dir='/xen/images/'
68 ios_name='C7200-JK.BIN'
70 #this instance configuration
71 name = domains[int(N)]
73 vbridges = vbridges_table[name]
75 vif=[]
76 x=1
77 for i in vbridges:
78 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
79 x+=1
81 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' ]
82 root = "/dev/hda1 ro"
84 xenomips='/xenomips/ios/'+ios_name+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
86 #for i in range(len(vbridges)-2):
87 # xenomips += ' -p '+str(i+1)+':PA-FE-TX'
88 #
89 #for i in range(len(vbridges)-1):
90 # xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i+1)
92 for i in range(len(vbridges)-1):
93 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
95 for i in range(len(vbridges)):
96 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
99 if domain_types[int(N)] == 'quagga':
100 extra = "quagga"
101 else:
102 extra = "xenomips=\""+xenomips+"\""
104 on_poweroff = 'destroy'
105 on_reboot = 'restart'
106 on_crash = 'restart'