xentaur

annotate xendomain.py @ 36:7bf7abe92123

domain start mini fixes
author nata
date Tue Sep 25 22:47:27 2007 +0300 (2007-09-25)
parents 244f1602496a
children 10444acb35f4
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:
nata@36 32 kernel = "/boot/vmlinuz-2.6.18-5-xen-686"
nata@36 33 ramdisk = "/boot/initrd.img-2.6.18-5-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@34 53 xenomips='/xenomips/ios/'+ios_name+' -t '+npe_type+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01'
igor@34 54
igor@34 55 for i in range(len(vbridges)-1):
igor@34 56 xenomips += ' -p '+str(i+1)+':PA-FE-TX'
igor@34 57
igor@34 58 for i in range(len(vbridges)):
igor@34 59 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i)
igor@34 60
igor@34 61 if domain_types[int(N)] == 'quagga':
igor@34 62 extra = "quagga"
igor@34 63 else:
igor@34 64 extra = "xenomips=\""+xenomips+"\""
igor@34 65
igor@34 66 on_poweroff = 'destroy'
igor@34 67 on_reboot = 'restart'
igor@34 68 on_crash = 'restart'
igor@34 69