xen-drbd

changeset 32:189e42c31b69

hvm disk parameter fixed
author igor@manas.xt.vpn
date Mon Aug 18 11:48:34 2008 +0300 (2008-08-18)
parents 5e499179b5ed
children 85165c844ac9
files xen-drbd-start.py
line diff
     1.1 --- a/xen-drbd-start.py	Thu Aug 14 22:04:16 2008 +0300
     1.2 +++ b/xen-drbd-start.py	Mon Aug 18 11:48:34 2008 +0300
     1.3 @@ -32,13 +32,23 @@
     1.4  vcpus=vcpus_table[domain]
     1.5  
     1.6  disk=[]
     1.7 -i=0
     1.8 -for disk_description in disk_table[domain]:
     1.9 -	i+=1
    1.10 -	if disk_description.find(":") == -1:
    1.11 -		disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) )
    1.12 -	else:
    1.13 -		disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) )
    1.14 +if domain_types[N] == 'hvm':
    1.15 +    letters='abcdefghijklmnopqrstuvwxyz'
    1.16 +    i=0
    1.17 +    for disk_description in disk_table[domain]:
    1.18 +        i+=1
    1.19 +        if disk_description.find(":") == -1:
    1.20 +            disk.append('phy:/dev/drbd/%s,hd%s,w' % (domain,letters[i-1]) )
    1.21 +        else:
    1.22 +            disk.append('phy:/dev/drbd/%s,hd%s,w' % ((disk_description.split(':'))[1],letters[i-1]) )
    1.23 +else:
    1.24 +    i=0
    1.25 +    for disk_description in disk_table[domain]:
    1.26 +        i+=1
    1.27 +        if disk_description.find(":") == -1:
    1.28 +            disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) )
    1.29 +        else:
    1.30 +            disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) )
    1.31  
    1.32  vif=[]
    1.33  vbridges = vbridges_table[domain]