igor@34: try: igor@34: from xenomips_vars import N igor@34: except: igor@34: print "can't find xenomips_vars module" igor@34: igor@34: igor@34: #### igor@34: # igor@34: # External variables: igor@34: # * network igor@34: # * domain igor@34: igor@34: igor@34: ############################################################################################ igor@34: # Topology description igor@34: igor@34: network='change-default-route' igor@34: igor@34: domains = [ 'dyn1', 'dyn2', 'dyn3', 'qua4', 'qua5', 'qua6', 'qua7', 'qua8', 'qua9', ] igor@34: domain_types = [ 'xenomips', 'xenomips', 'xenomips', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', 'quagga', ] igor@34: bridges = [ igor@34: 'vlan100', igor@34: 'vlan101', igor@34: 'vlan102', igor@34: 'vlan103', igor@34: 'vlan104', igor@34: 'vlan105', igor@34: 'vlan106', igor@34: 'vlan107', igor@34: 'vlan108', igor@34: 'vlan109', igor@34: 'vlan110', igor@34: 'vlan111', igor@34: ] igor@34: igor@34: vbridges_table = { igor@34: 'dyn1' : [ 'vlan101', 'vlan102' ], igor@34: 'dyn2' : [ 'vlan101', 'vlan103' ], igor@34: 'dyn3' : [ 'vlan102', 'vlan103', 'vlan104' ], igor@34: igor@34: 'qua4' : [ 'vlan105', 'vlan106', 'vlan111' ], igor@34: 'qua5' : [ 'vlan110', 'vlan111' ], igor@34: 'qua6' : [ 'vlan109', 'vlan110' ], igor@34: 'qua7' : [ 'vlan108', 'vlan109' ], igor@34: 'qua8' : [ 'vlan107', 'vlan108' ], igor@34: 'qua9' : [ 'vlan106', 'vlan107' ], igor@34: } igor@34: igor@34: hidden_bridges = [] igor@34: broken_links = [] igor@34: temporary_links = [] igor@34: igor@34: xenomips_dir='/xen/images/' igor@34: ios_name='C7200-JK.BIN' igor@34: npe_type="npe-200" igor@34: igor@34: name = domain igor@34: igor@34: # property should be specified only to override default values igor@34: properties = { igor@34: 'dyn1': { igor@34: npe_type: "npe-400", igor@34: } igor@34: } igor@34: igor@34: #this instance configuration igor@34: if domain_types[domain] == 'quagga': igor@34: memory = 64 igor@34: else: igor@34: memory = 400 igor@34: igor@34: ############################################################################################ igor@34: igor@34: N = domains.index(domain) igor@34: igor@34: pae=1 igor@34: if pae: igor@34: kernel = "/boot/vmlinuz-2.6.18-4-xen-686" igor@34: ramdisk = "/boot/initrd.img-2.6.18-4-xen-686" igor@34: else: igor@34: kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686" igor@34: ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU" igor@34: igor@34: #builder='linux' igor@34: cpu_cap = 10 igor@34: igor@34: igor@34: vbridges = vbridges_table[name] igor@34: igor@34: vif=[] igor@34: x=1 igor@34: for i in vbridges: igor@34: vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:]) igor@34: x+=1 igor@34: igor@34: 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' ] igor@34: root = "/dev/hda1 ro" igor@34: igor@34: xenomips='/xenomips/ios/'+ios_name+' -t '+npe_type+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01' igor@34: igor@34: for i in range(len(vbridges)-1): igor@34: xenomips += ' -p '+str(i+1)+':PA-FE-TX' igor@34: igor@34: for i in range(len(vbridges)): igor@34: xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i) igor@34: igor@34: if domain_types[int(N)] == 'quagga': igor@34: extra = "quagga" igor@34: else: igor@34: extra = "xenomips=\""+xenomips+"\"" igor@34: igor@34: on_poweroff = 'destroy' igor@34: on_reboot = 'restart' igor@34: on_crash = 'restart' igor@34: