rev |
line source |
igor@34
|
1 ####
|
igor@34
|
2 #
|
igor@34
|
3 # External variables:
|
igor@34
|
4 # * network
|
igor@34
|
5 # * domain
|
igor@34
|
6
|
igor@34
|
7
|
igor@35
|
8 try:
|
igor@35
|
9 domain
|
igor@35
|
10 except NameError:
|
igor@35
|
11 import sys
|
igor@35
|
12 network=sys.modules['__main__'].network
|
igor@35
|
13 domain=sys.modules['__main__'].domain
|
igor@34
|
14
|
nata@36
|
15 import os
|
nata@36
|
16 sys.path.append(os.environ['HOME']+"/xentaur")
|
nata@36
|
17 os.environ['xendomain']=domain
|
nata@36
|
18
|
igor@35
|
19 #try:
|
igor@34
|
20
|
igor@35
|
21 exec 'from %s import *' % (network)
|
igor@35
|
22 #except:
|
igor@35
|
23 # print "Can't find or interpret module %s with topology description" %(network)
|
igor@35
|
24 # sys.exit(1)
|
igor@34
|
25
|
igor@34
|
26
|
igor@35
|
27 N = str(domains.index(domain))
|
igor@35
|
28 name=domain
|
igor@34
|
29
|
igor@34
|
30 pae=1
|
igor@34
|
31 if pae:
|
igor@40
|
32 kernel = "/boot/vmlinuz-2.6.18-4-xen-686"
|
igor@40
|
33 ramdisk = "/boot/initrd.img-2.6.18-4-xen-686"
|
igor@34
|
34 else:
|
igor@34
|
35 kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686"
|
igor@34
|
36 ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU"
|
igor@34
|
37
|
igor@34
|
38 #builder='linux'
|
igor@34
|
39 cpu_cap = 10
|
igor@34
|
40
|
igor@34
|
41
|
igor@34
|
42 vbridges = vbridges_table[name]
|
igor@34
|
43
|
igor@34
|
44 vif=[]
|
igor@34
|
45 x=1
|
igor@34
|
46 for i in vbridges:
|
igor@34
|
47 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
|
igor@34
|
48 x+=1
|
igor@34
|
49
|
igor@34
|
50 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
|
51 root = "/dev/hda1 ro"
|
igor@34
|
52
|
igor@42
|
53 platform_option=""
|
igor@42
|
54 if platform != '7200':
|
igor@42
|
55 platform_option=' -P '+platform
|
igor@42
|
56
|
igor@42
|
57 npe_option=""
|
igor@42
|
58 if platform == '7200':
|
igor@42
|
59 npe_option=" -t "+npe_type
|
igor@42
|
60
|
igor@42
|
61 xenomips='/xenomips/ios/'+ios_name+platform_option+npe_option+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
|
igor@34
|
62
|
igor@34
|
63 for i in range(len(vbridges)-1):
|
igor@34
|
64 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
|
igor@34
|
65
|
igor@34
|
66 for i in range(len(vbridges)):
|
igor@34
|
67 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
|
igor@34
|
68
|
igor@34
|
69 if domain_types[int(N)] == 'quagga':
|
igor@34
|
70 extra = "quagga"
|
igor@34
|
71 else:
|
igor@34
|
72 extra = "xenomips=\""+xenomips+"\""
|
igor@34
|
73
|
igor@34
|
74 on_poweroff = 'destroy'
|
igor@34
|
75 on_reboot = 'restart'
|
igor@34
|
76 on_crash = 'restart'
|
igor@34
|
77
|