Esempio n. 1
0
	def MapLinearVolume(self, volumename, devlist):
		tblist = []
		start = 0
		for dev in devlist:
			size = dev.size*2048
			params = dev.parameters[1] + ' 0'
			table = dm.table(start, size, 'linear', params)
			tblist.append(table)
			start += size
		dm.map(volumename, tblist)
		return True
Esempio n. 2
0
	def MapMirrorVolume(self, volumename, devlist):
		tblist = []
		start = 0
		params = 'core 2 64 nosync ' + len(devlist)
		for dev in devlist:
			size += dev.size*2048
			params += ' ' + dev.parameters[1] + ' 0'
		table = dm.table(start, size, 'mirror', params)
		tblist.append(table)
		dm.map(volumename, tblist)
		return True
Esempio n. 3
0
 def MapMirrorVolume(self, volumename, devlist):
     tblist = []
     start = 0
     params = 'core 2 64 nosync ' + len(devlist)
     for dev in devlist:
         size += dev.size * 2048
         params += ' ' + dev.parameters[1] + ' 0'
     table = dm.table(start, size, 'mirror', params)
     tblist.append(table)
     dm.map(volumename, tblist)
     return True
Esempio n. 4
0
 def MapLinearVolume(self, volumename, devlist):
     tblist = []
     start = 0
     for dev in devlist:
         size = dev.size * 2048
         params = dev.parameters[1] + ' 0'
         table = dm.table(start, size, 'linear', params)
         tblist.append(table)
         start += size
     dm.map(volumename, tblist)
     return True
Esempio n. 5
0
	def MapStripedVolume(self, volumename, strsize, devlist):
		tblist = []
		start = 0
		size = 0
		params = str( len(devlist) ) + ' ' + str( strsize )
		for dev in devlist:
			size += dev.size*2048
			params += ' ' + dev.parameters[1] + ' 0'
		print params
		table = dm.table(start, size, 'striped', params)
		tblist.append(table)
		dm.map(volumename, tblist)
		return True
Esempio n. 6
0
 def MapStripedVolume(self, volumename, strsize, devlist):
     tblist = []
     start = 0
     size = 0
     params = str(len(devlist)) + ' ' + str(strsize)
     for dev in devlist:
         size += dev.size * 2048
         params += ' ' + dev.parameters[1] + ' 0'
     print params
     table = dm.table(start, size, 'striped', params)
     tblist.append(table)
     dm.map(volumename, tblist)
     return True
Esempio n. 7
0
	def MapGFSVolume(self, volumename, devlist):
		tblist = []
		start = 0
		num = len(devlist)
		i = 0
		while i < num:
			params = 'core 2 64 nosync 3'
			params += ' '+devlist[i].parameters[1]+' 0'
			params += ' '+devlist[i+1].parameters[1]+' 0'
			params += ' '+devlist[i+2].parameters[1]+' 0'
			size = devlist[i].size*2048
			table = dm.table(start, size, 'mirror', params)
			tblist.append(table)
			start += size
			i += 3
		dm.map(volumename, tblist)
		return True
Esempio n. 8
0
 def MapGFSVolume(self, volumename, devlist):
     tblist = []
     start = 0
     num = len(devlist)
     i = 0
     while i < num:
         params = 'core 2 64 nosync 3'
         params += ' ' + devlist[i].parameters[1] + ' 0'
         params += ' ' + devlist[i + 1].parameters[1] + ' 0'
         params += ' ' + devlist[i + 2].parameters[1] + ' 0'
         size = devlist[i].size * 2048
         table = dm.table(start, size, 'mirror', params)
         tblist.append(table)
         start += size
         i += 3
     dm.map(volumename, tblist)
     return True