xentaur
diff xendomain.py @ 62:e838c1223b89
Делаются какие-то попытки интегрировать в Xentaur
управление разнообразными доменами.
управление разнообразными доменами.
author | igor |
---|---|
date | Thu Feb 21 21:41:20 2008 +0200 (2008-02-21) |
parents | 6471afbee150 |
children | 07c6777758dc |
line diff
1.1 --- a/xendomain.py Mon Dec 03 08:36:13 2007 +0200 1.2 +++ b/xendomain.py Thu Feb 21 21:41:20 2008 +0200 1.3 @@ -91,7 +91,22 @@ 1.4 #builder='linux' 1.5 cpu_cap = 10 1.6 1.7 +hvm = 0 1.8 +if domain_types[N] in ['freebsd','windows']: 1.9 + hvm = 1 1.10 1.11 +if hvm: 1.12 + kernel = "hvmloader" 1.13 + builder='hvm' 1.14 + shadow_memory = 8 1.15 + device_model = 'qemu-dm' 1.16 + boot="c" 1.17 + sdl=0 1.18 + vnc=1 1.19 + vncpasswd='' 1.20 + stdvga=0 1.21 + serial='pty' 1.22 + usb=1 1.23 1.24 1.25 for br in bridges: 1.26 @@ -107,16 +122,32 @@ 1.27 vif=[] 1.28 x=1 1.29 for i in vbridges: 1.30 - vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) 1.31 + if hvm: 1.32 + vif.append('bridge='+i+',type=ioemu,mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) 1.33 + else: 1.34 + vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(N)[2:]+':'+hex(int('c0',16)+x)[2:]) 1.35 x+=1 1.36 1.37 -disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+str(N)+'.img,hda3,w' ] 1.38 +if domain_types[N] in ['xenomips','quagga','dynamips','pixemu']: 1.39 + disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+str(N)+'.img,hda3,w' ] 1.40 +else: 1.41 + if hvm: 1.42 + if domain_types[N] == 'linux': 1.43 + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda,w' ] 1.44 + else: 1.45 + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda,w', 'file:/xen/xentaur-images/'+network+'/'+name+'-disk2.img,hdb,w' ] 1.46 + 1.47 + else: 1.48 + disk = [ 'file:/xen/xentaur-images/'+network+'/'+name+'.img,hda1,w' ] 1.49 + 1.50 root = "/dev/hda1 ro" 1.51 1.52 if domain_types[N] == 'quagga': 1.53 memory = 64 1.54 +elif domain_types[N] == 'linux': 1.55 + memory = 550 1.56 else: 1.57 - memory = 400 1.58 + memory = 300 1.59 1.60 if len(domain_subtypes) >0 and domain_subtypes[N] != '' and platform == '': 1.61 platform=domain_subtypes[N] 1.62 @@ -162,7 +193,8 @@ 1.63 xenomips="./pemu -net nic,vlan=1,macaddr=00:aa:00:00:02:01 -net pcap,vlan=1,ifname=eth0 -net nic,vlan=2,macaddr=00:aa:00:00:02:02 -net pcap,vlan=2,ifname=eth1 -serial stdio -m 128 FLASH"+' /xenomips/ios/'+ios_name 1.64 extra = "xenomips=\""+xenomips+"\"" 1.65 else: 1.66 - raise "Unknown domain type %s of domain %s " % (domain_types[N], domains[N]) 1.67 + if not domain_types[N] in ['freebsd','windows','linux'] : 1.68 + raise "Unknown domain type %s of domain %s " % (domain_types[N], domains[N]) 1.69 1.70 on_poweroff = 'destroy' 1.71 on_reboot = 'restart'