xen-drbd

diff xen-drbd-start.py @ 36:44efea4507ac

Virtual disk name can be secified after = sign (e.g.: drbd1=sda1:dns:2G )
author igor@manas.xt.vpn
date Sat Aug 30 11:14:50 2008 +0300 (2008-08-30)
parents 189e42c31b69
children 30671fe7fd79
line diff
     1.1 --- a/xen-drbd-start.py	Mon Aug 18 11:48:34 2008 +0300
     1.2 +++ b/xen-drbd-start.py	Sat Aug 30 11:14:50 2008 +0300
     1.3 @@ -38,17 +38,34 @@
     1.4      for disk_description in disk_table[domain]:
     1.5          i+=1
     1.6          if disk_description.find(":") == -1:
     1.7 -            disk.append('phy:/dev/drbd/%s,hd%s,w' % (domain,letters[i-1]) )
     1.8 +            disk_name=disk_description
     1.9 +            if disk_name.find("=") == -1:
    1.10 +                disk.append('phy:/dev/drbd/%s,hd%s,w' % (domain,letters[i-1]) )
    1.11 +            else:
    1.12 +                disk.append('phy:/dev/drbd/%s,%s,w' % (domain,(disk_name.split("="))[1]) )
    1.13          else:
    1.14 -            disk.append('phy:/dev/drbd/%s,hd%s,w' % ((disk_description.split(':'))[1],letters[i-1]) )
    1.15 +            disk_name=(disk_description.split(':'))[0]
    1.16 +            if disk_name.find("=") == -1:
    1.17 +                disk.append('phy:/dev/drbd/%s,hd%s,w' % ((disk_description.split(':'))[1],letters[i-1]) )
    1.18 +            else:
    1.19 +                disk.append('phy:/dev/drbd/%s,%s,w' % ((disk_description.split(':'))[1],(disk_name.split("="))[1]) )
    1.20 +                
    1.21  else:
    1.22      i=0
    1.23      for disk_description in disk_table[domain]:
    1.24          i+=1
    1.25          if disk_description.find(":") == -1:
    1.26 -            disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) )
    1.27 +            disk_name=disk_description
    1.28 +            if disk_name.find("=") == -1:
    1.29 +                disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) )
    1.30 +            else:
    1.31 +                disk.append('phy:/dev/drbd/%s,%s,w' % (domain,(disk_name.split("="))[1]) )
    1.32          else:
    1.33 -            disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) )
    1.34 +            disk_name=(disk_description.split(':'))[0]
    1.35 +            if disk_name.find("=") == -1:
    1.36 +                disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) )
    1.37 +            else:
    1.38 +                disk.append('phy:/dev/drbd/%s,%s,w' % ((disk_description.split(':'))[1],(disk_name.split("="))[1]) )
    1.39  
    1.40  vif=[]
    1.41  vbridges = vbridges_table[domain]