Logical Volume Management¶
LVM management functions.
- lmi.scripts.storage.lvm.create_lv(ns, vg, name, size)¶
Create new Logical Volume on given Volume Group.
Parameters: - vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to allocate the volume from.
- name (string) – Name of the logical volume.
- size (int) – Size of the logical volume in bytes.
Return type: LMIInstance/LMI_LVStorageExtent
- lmi.scripts.storage.lvm.create_vg(ns, devices, name, extent_size=None)¶
Create new Volume Group from given devices.
Parameters: - device – Devices to add to the Volume Group.
- name (string) – Name of the Volume gGoup.
- extent_size (int) – Extent size in bytes.
Return type: LMIInstance/LMI_VGStoragePool
- lmi.scripts.storage.lvm.delete_lv(ns, lv)¶
Destroy given Logical Volume.
Parameters: lv (LMIInstance/LMI_LVStorageExtent or string) – Logical Volume to destroy.
- lmi.scripts.storage.lvm.delete_vg(ns, vg)¶
Destroy given Volume Group.
Parameters: vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to delete.
- lmi.scripts.storage.lvm.get_lv_vg(ns, lv)¶
Return Volume Group of given Logical Volume.
Parameters: lv (LMIInstance/LMI_LVStorageExtent or string) – Logical Volume to examine. Return type: LMIInstance/LMI_VGStoragePool
- lmi.scripts.storage.lvm.get_lvs(ns, vgs=None)¶
Retrieve list of all logical volumes allocated from given volume groups.
If no volume groups are provided, all logical volumes on the system are returned.
Parameters: vgs (list of LMIInstance/LMI_VGStoragePool or list of strings) – Volume Groups to examine. Return type: list of LMIInstance/LMI_LVStorageExtent.
- lmi.scripts.storage.lvm.get_tp_vgs(ns, tp)¶
Return Volume Groups of given Thin Pool.
Alias for get_vg_tps.
- lmi.scripts.storage.lvm.get_tps(ns)¶
Retrieve list of all thin pools on the system.
Return type: list of LMIInstance/LMI_VGStoragePool
- lmi.scripts.storage.lvm.get_vg_lvs(ns, vg)¶
Return list of Logical Volumes on given Volume Group.
Parameters: vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to examine. Return type: list of LMIInstance/LMI_LVStorageExtent
- lmi.scripts.storage.lvm.get_vg_pvs(ns, vg)¶
Return Physical Volumes of given Volume Group.
Parameters: vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to examine. Return type: list of LMIInstance/CIM_StorageExtent
- lmi.scripts.storage.lvm.get_vg_tps(ns, vg)¶
Return Thin Pools of given Volume Group.
Parameters: vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to examine. Return type: list of LMIInstance/CIM_StoragePool
- lmi.scripts.storage.lvm.get_vgs(ns)¶
Retrieve list of all volume groups on the system.
Return type: list of LMIInstance/LMI_VGStoragePool
- lmi.scripts.storage.lvm.modify_vg(ns, vg, add_pvs=None, remove_pvs=None)¶
Modify given Volume Group.
Add ‘add_pvs’ devices as Physical Volumes of the group. Remove ‘remove_pvs’ devices from the Volume Group.
Parameters: - vg (LMIInstance/LMI_VGStoragePool or string) – Volume Group to delete.
- add_pvs (List of LMIInstances/LMI_VGStoragePools or strings) – List of new devices to be added as Physical Volumes of the VG.
- remove_pvs (List of LMIInstances/LMI_VGStoragePools or strings) – List of Physical Volume to be removed from the VG.