xentaur

annotate examples/fabergeN @ 16:360ec7b5616c

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