# HG changeset patch # User igor@manas.xt.vpn # Date 1220084090 -10800 # Node ID 44efea4507acf9b625f9dc115d2805c3ab9b332e # Parent cbd4d942d0595ba7e65e0c981b4fb8b23652e22a Virtual disk name can be secified after = sign (e.g.: drbd1=sda1:dns:2G ) diff -r cbd4d942d059 -r 44efea4507ac eb.py --- a/eb.py Mon Aug 18 21:27:14 2008 +0300 +++ b/eb.py Sat Aug 30 11:14:50 2008 +0300 @@ -57,7 +57,7 @@ disk_table={ 'gw' : ['drbd1'], 'igw' : ['drbd2'], - 'dns' : ['drbd3'], + 'dns' : ['drbd3=sda1'], 'vpn' : ['drbd4'], 'apt' : ['drbd5'], 'proxy' : ['drbd6'], diff -r cbd4d942d059 -r 44efea4507ac od.py --- a/od.py Mon Aug 18 21:27:14 2008 +0300 +++ b/od.py Sat Aug 30 11:14:50 2008 +0300 @@ -63,7 +63,7 @@ disk_table={ 'gw' : ['drbd1:gw:2G'], 'igw' : ['drbd2:igw:2G'], - 'dns' : ['drbd3:dns:2G'], + 'dns' : ['drbd3=sda1:dns:2G'], 'vpn' : ['drbd4:vpn:2G'], 'apt' : ['drbd5:apt:10G'], 'pgw' : ['drbd6:pgw:2G'], diff -r cbd4d942d059 -r 44efea4507ac xen-drbd-install.py --- a/xen-drbd-install.py Mon Aug 18 21:27:14 2008 +0300 +++ b/xen-drbd-install.py Sat Aug 30 11:14:50 2008 +0300 @@ -43,9 +43,13 @@ for dom in domains: for disk in disk_table[dom]: if disk.find(":") == -1: - drbd_device[disk]=dom + if disk.find("=") == -1: + drbd_device[disk]=dom + else: + drbd_device[disk.split('=')[0]]=dom else: - drbd_device[disk.split(':')[0]]=disk.split(':')[1] + disk0=disk.split(':')[0] + drbd_device[disk0.split('=')[0]]=disk.split(':')[1] def make_lvm(): print "###################################################" diff -r cbd4d942d059 -r 44efea4507ac xen-drbd-start.py --- a/xen-drbd-start.py Mon Aug 18 21:27:14 2008 +0300 +++ b/xen-drbd-start.py Sat Aug 30 11:14:50 2008 +0300 @@ -38,17 +38,34 @@ for disk_description in disk_table[domain]: i+=1 if disk_description.find(":") == -1: - disk.append('phy:/dev/drbd/%s,hd%s,w' % (domain,letters[i-1]) ) + disk_name=disk_description + if disk_name.find("=") == -1: + disk.append('phy:/dev/drbd/%s,hd%s,w' % (domain,letters[i-1]) ) + else: + disk.append('phy:/dev/drbd/%s,%s,w' % (domain,(disk_name.split("="))[1]) ) else: - disk.append('phy:/dev/drbd/%s,hd%s,w' % ((disk_description.split(':'))[1],letters[i-1]) ) + disk_name=(disk_description.split(':'))[0] + if disk_name.find("=") == -1: + disk.append('phy:/dev/drbd/%s,hd%s,w' % ((disk_description.split(':'))[1],letters[i-1]) ) + else: + disk.append('phy:/dev/drbd/%s,%s,w' % ((disk_description.split(':'))[1],(disk_name.split("="))[1]) ) + else: i=0 for disk_description in disk_table[domain]: i+=1 if disk_description.find(":") == -1: - disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) ) + disk_name=disk_description + if disk_name.find("=") == -1: + disk.append('phy:/dev/drbd/%s,hda%s,w' % (domain,i) ) + else: + disk.append('phy:/dev/drbd/%s,%s,w' % (domain,(disk_name.split("="))[1]) ) else: - disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) ) + disk_name=(disk_description.split(':'))[0] + if disk_name.find("=") == -1: + disk.append('phy:/dev/drbd/%s,hda%s,w' % ((disk_description.split(':'))[1],i) ) + else: + disk.append('phy:/dev/drbd/%s,%s,w' % ((disk_description.split(':'))[1],(disk_name.split("="))[1]) ) vif=[] vbridges = vbridges_table[domain]