コード例 #1
0
ファイル: DeviceMapperClient.py プロジェクト: lihuiba/SoftSAN
	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
コード例 #2
0
ファイル: DeviceMapperClient.py プロジェクト: lihuiba/SoftSAN
	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
コード例 #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
コード例 #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
コード例 #5
0
ファイル: DeviceMapperClient.py プロジェクト: lihuiba/SoftSAN
	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
コード例 #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
コード例 #7
0
ファイル: DeviceMapperClient.py プロジェクト: lihuiba/SoftSAN
	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
コード例 #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