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
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
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
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
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
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
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
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