xen-drbd

diff xen-drbd-start.py @ 31:5e499179b5ed

Добавлена поддержка HVM-доменов; параметры migrate-all-out и migrate-all-in заменены, соответственно, на migrate-out-all и migrate-in-all
author igor@manas.xt.vpn
date Thu Aug 14 22:04:16 2008 +0300 (2008-08-14)
parents 1c7442c793a1
children 189e42c31b69
line diff
     1.1 --- a/xen-drbd-start.py	Fri Oct 05 16:59:35 2007 +0300
     1.2 +++ b/xen-drbd-start.py	Thu Aug 14 22:04:16 2008 +0300
     1.3 @@ -17,6 +17,16 @@
     1.4  name=domain
     1.5  N = domains.index(domain)
     1.6  
     1.7 +if domain_types[N] == 'hvm':
     1.8 +    kernel='hvmloader'
     1.9 +    builder='hvm'
    1.10 +    device_model='qemu-dm'
    1.11 +    boot='c'
    1.12 +    sdl=0
    1.13 +    vnc=1
    1.14 +    vncconsole=0
    1.15 +    stdvga=0
    1.16 +    serial='pty'
    1.17  
    1.18  memory=mem_table[domain]
    1.19  vcpus=vcpus_table[domain]
    1.20 @@ -34,20 +44,41 @@
    1.21  vbridges = vbridges_table[domain]
    1.22  x=1
    1.23  for i in vbridges:
    1.24 - vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
    1.25 - x+=1
    1.26 +    if domain_types[N] == 'hvm':
    1.27 +        vif.append('type=ioemu, bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
    1.28 +    else:
    1.29 +        vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
    1.30 +    x+=1
    1.31 +
    1.32  
    1.33  root="/dev/hda1 ro"
    1.34  extra=""
    1.35  
    1.36  def print_config():
    1.37 -    print "name =", name
    1.38 -    print "kernel =", kernel
    1.39 -    print "ramdisk =", ramdisk
    1.40 -    print "memory =", memory
    1.41 -    print "vcpus =", vcpus
    1.42 -    print "disk =", disk
    1.43 -    print "vif =", vif
    1.44 -    print "root =", root
    1.45 -    print "extra =", extra
    1.46 +    if domain_types[N] == 'hvm':
    1.47 +        print "name = \"%s\""% name
    1.48 +        print "kernel = \"%s\""% kernel
    1.49 +        print "builder = \"%s\""% builder
    1.50 +        print "memory = %s"% memory
    1.51 +        print "device_model=\"%s\"" % device_model
    1.52 +        print "vcpus = %s"% vcpus
    1.53 +        print "disk =", disk
    1.54 +        print "vif =", vif
    1.55 +        print "boot=\"%s\""%boot
    1.56 +        print "sdl=%s"%sdl
    1.57 +        print "vnc=%s"%vnc
    1.58 +        print "vncconsole=%s"%vncconsole
    1.59 +        print "stdvga=%s"%stdvga
    1.60 +        print "serial=\"%s\""%serial
    1.61 +    else:
    1.62 +        print "name = \"%s\""% name
    1.63 +        print "kernel = \"%s\""% kernel
    1.64 +        print "ramdisk = \"%s\""% ramdisk
    1.65 +        print "memory = %s"% memory
    1.66 +        print "vcpus = %s"% vcpus
    1.67 +        print "disk =", disk
    1.68 +        print "vif =", vif
    1.69 +        print "root = \"%s\""% root
    1.70 +        print "extra = \"%s\""% extra
    1.71 +#    else:
    1.72