def execute(self, ns, tps=None): """ Implementation of 'thinlv list' command. """ for tlv in lvm.get_tlvs(ns, tps): size = size2str(tlv.NumberOfBlocks * tlv.BlockSize, self.app.config.human_friendly) tp = lvm.get_lv_vg(ns, tlv) yield (tlv.ElementName, tp.ElementName, size)
def tlv_show(ns, tlv, human_friendly): """ Print extended information about the Thin Logical Volume. :type tlv: LMIInstance/LMI_LVStorageExtent or string :param tlv: Thin Logical Volume to show. """ tlv = common.str2device(ns, tlv) yield ("Type", "Thin Logical Volume") for line in device_show_device(ns, tlv, human_friendly): yield line tp = lvm.get_lv_vg(ns, tlv) yield ("Thin Pool", tp.ElementName) vgs = lvm.get_tp_vgs(ns, tp) vgnames = [vg.Name for vg in vgs] yield ("Volume Group", " ".join(vgnames))
def lv_show(ns, lv, human_friendly): """ Print extended information about the Logical Volume. :type lv: LMIInstance/LMI_LVStorageExtent or string :param lv: Logical Volume to show. """ lv = common.str2device(ns, lv) yield ("Type", "Logical Volume") for line in device_show_device(ns, lv, human_friendly): yield line vg = lvm.get_lv_vg(ns, lv) yield ("Volume Group", vg.ElementName) yield ("Extent Size", common.size2str(vg.ExtentSize, human_friendly)) yield ("Number of Occupied Extents", lv.BlockSize * lv.NumberOfBlocks / vg.ExtentSize) for line in device_show_data(ns, lv, human_friendly): yield line
def lv_show(ns, lv, human_friendly): """ Print extended information about the Logical Volume. :type lv: LMIInstance/LMI_LVStorageExtent or string :param lv: Logical Volume to show. """ lv = common.str2device(ns, lv) yield ("Type", "Logical Volume") for line in device_show_device(ns, lv, human_friendly): yield line vg = lvm.get_lv_vg(ns, lv) yield ("Volume Group", vg.ElementName) yield ("Extent Size", common.size2str(vg.ExtentSize, human_friendly)) yield("Number of Occupied Extents", \ lv.BlockSize * lv.NumberOfBlocks / vg.ExtentSize) for line in device_show_data(ns, lv, human_friendly): yield line