# HG changeset patch # User igor@manas.xt.vpn # Date 1218740656 -10800 # Node ID 5e499179b5edaccb50ced05dad910c43877c3c96 # Parent fc4025aa8287ffe3ee454bc12df637fe37c6590e Добавлена поддержка HVM-доменов; параметры migrate-all-out и migrate-all-in заменены, соответственно, на migrate-out-all и migrate-in-all diff -r fc4025aa8287 -r 5e499179b5ed od.py --- a/od.py Sun Jun 29 15:47:02 2008 +0300 +++ b/od.py Thu Aug 14 22:04:16 2008 +0300 @@ -1,5 +1,5 @@ -node1='debian' +node1='manas' node2='mirror' #i_am=node1 @@ -15,7 +15,8 @@ node1_ip=ip_address[node1] node2_ip=ip_address[node2] -domains=[ 'gw', 'igw', 'dns', 'vpn', 'apt', 'pgw', 'ldap', 'mail', 'uucp', 'samba', ] +domains= [ 'gw', 'igw', 'dns', 'vpn', 'apt', 'pgw', 'ldap', 'mail', 'uucp', 'samba', 'test'] +domain_types= [ 'linux', 'linux', 'linux', 'linux', 'linux', 'linux', 'linux', 'linux', 'linux', 'linux', 'hvm' ] domain_home = { node1 : ['dns', 'gw', 'igw', 'pgw', 'ldap', 'mail', 'vpn', 'uucp', 'apt'], @@ -36,6 +37,7 @@ 'vpn' :192, 'uucp' :128, 'apt' :128, + 'test' :128, } vcpus_table={ @@ -49,6 +51,7 @@ 'vpn' :4, 'uucp' :4, 'apt' :2, + 'test' :2, } lvm_vg_name="TURBO" @@ -73,6 +76,7 @@ 'drbd14:samba-nbumail:100G', 'drbd17:samba-profiles:100G' ], + 'test' : ['drbd18:test:3G'], } bridges=['tagged0', 'xenbr1', 'xenbr256', 'xenbr257', 'xenbr3', 'xenbr4', 'xenbr501'] @@ -94,6 +98,7 @@ 'vpn' : ['xenbr3'], 'apt' : ['xenbr3'], 'uucp' : ['xenbr3'], + 'test' : ['xenbr3'], } # FOR INSTALLATION ONLY diff -r fc4025aa8287 -r 5e499179b5ed xen-drbd-start.py --- a/xen-drbd-start.py Sun Jun 29 15:47:02 2008 +0300 +++ b/xen-drbd-start.py Thu Aug 14 22:04:16 2008 +0300 @@ -17,6 +17,16 @@ name=domain N = domains.index(domain) +if domain_types[N] == 'hvm': + kernel='hvmloader' + builder='hvm' + device_model='qemu-dm' + boot='c' + sdl=0 + vnc=1 + vncconsole=0 + stdvga=0 + serial='pty' memory=mem_table[domain] vcpus=vcpus_table[domain] @@ -34,20 +44,41 @@ vbridges = vbridges_table[domain] x=1 for i in vbridges: - vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:]) - x+=1 + if domain_types[N] == 'hvm': + vif.append('type=ioemu, bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:]) + else: + vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:]) + x+=1 + root="/dev/hda1 ro" extra="" def print_config(): - print "name =", name - print "kernel =", kernel - print "ramdisk =", ramdisk - print "memory =", memory - print "vcpus =", vcpus - print "disk =", disk - print "vif =", vif - print "root =", root - print "extra =", extra + if domain_types[N] == 'hvm': + print "name = \"%s\""% name + print "kernel = \"%s\""% kernel + print "builder = \"%s\""% builder + print "memory = %s"% memory + print "device_model=\"%s\"" % device_model + print "vcpus = %s"% vcpus + print "disk =", disk + print "vif =", vif + print "boot=\"%s\""%boot + print "sdl=%s"%sdl + print "vnc=%s"%vnc + print "vncconsole=%s"%vncconsole + print "stdvga=%s"%stdvga + print "serial=\"%s\""%serial + else: + print "name = \"%s\""% name + print "kernel = \"%s\""% kernel + print "ramdisk = \"%s\""% ramdisk + print "memory = %s"% memory + print "vcpus = %s"% vcpus + print "disk =", disk + print "vif =", vif + print "root = \"%s\""% root + print "extra = \"%s\""% extra +# else: diff -r fc4025aa8287 -r 5e499179b5ed xen-drbd.py --- a/xen-drbd.py Sun Jun 29 15:47:02 2008 +0300 +++ b/xen-drbd.py Thu Aug 14 22:04:16 2008 +0300 @@ -141,11 +141,11 @@ xm_domains=run_now("xm list | awk '{print $1}'", node).split("\n") return filter(lambda x: x in xm_domains, domains) -def migrate_all_out(node=i_am): +def migrate_out_all(node=i_am): for domain in running_domains(node): migrate_domain_out(domain,node) -def migrate_all_in(node=i_am): +def migrate_in_all(node=i_am): for domain in running_domains(the_peer_of(node)): migrate_domain_in(domain,node) @@ -257,10 +257,10 @@ start_all() elif command == 'start-my-domains': start_my_domains() - elif command == 'migrate-all-out': - migrate_all_out() - elif command == 'migrate-all-in': - migrate_all_in() + elif command == 'migrate-out-all': + migrate_out_all() + elif command == 'migrate-in-all': + migrate_in_all() elif command == 'migrate-my-domains-home': migrate_my_domains_home() elif command == 'migrate-and-start-my-domains':