def thinpool_LV(): device = '/dev/sdd' vg_name = 'TEST_VG' lv_pool = 'TEST_POOL' lv_thin = 'TEST_THIN' lvm.pvCreate(device) vg = lvm.vgCreate(vg_name) vg.extend('/dev/sdd') pv_list = vg.listPVs() for pv in pv_list: print 'PV name: ', pv.getName(), ' ID: ', pv.getUuid( ), 'Size: ', pv.getSize() lv = vg.createLvThinpool(lv_pool, 1024 * 1024 * 1024) lv2 = vg.createLvThin(lv.getName(), lv_thin, 1024 * 1024 * 1024 * 1024) print lv2.deactivate() print lv2.getAttr() print lv.deactivate() print lv.getAttr() raw_input('acticate?') print lv.activate() print lv.getAttr() print lv2.activate() print lv2.getAttr() vg.close() raw_input('??') #vg.reduce('/dev/sdd') vg = lvm.vgOpen(vg_name, 'w') lv = vg.lvFromName(lv_thin) lv.remove() lv = vg.lvFromName(lv_pool) lv.remove() vg.remove() lvm.configReload() lvm.pvRemove(device) return True
def normal_LV(): lvm.pvCreate(device) vg = lvm.vgCreate(vg_name) vg.extend('/dev/sdd') pv_list = vg.listPVs() for pv in pv_list: print 'PV name: ', pv.getName(), ' ID: ', pv.getUuid( ), 'Size: ', pv.getSize() lv = vg.createLvLinear(lv_name, 1024 * 1024 * 1024) print lv.deactivate() print lv.getAttr() raw_input('acticate?') print lv.activate() print lv.getAttr() vg.close() raw_input('??') #vg.reduce('/dev/sdd') vg = lvm.vgOpen(vg_name, 'w') lv = vg.lvFromName(lv_name) lv.remove() vg.remove() lvm.configReload() lvm.pvRemove(device) return True
def test_config_reload(self): self.assertEqual(lvm.configReload(), None)