LVM class for performing LVM operations.
LVM
(vg_name, root_helper, create_vg=False, physical_volumes=None, lvm_type='default', executor=<function execute>, lvm_conf=None, suppress_fd_warn=False)¶Bases: os_brick.executor.Executor
LVM object to enable various LVM related operations.
LVM_CMD_PREFIX
= ['env', 'LC_ALL=C']¶activate_lv
(name, is_snapshot=False, permanent=False)¶Ensure that logical volume/snapshot logical volume is activated.
Parameters: |
|
---|---|
Raises: | putils.ProcessExecutionError – |
create_lv_snapshot
(name, source_lv_name, lv_type='default', snapshot_clone_size=None, size=None)¶Creates a snapshot of a logical volume.
Parameters: |
|
---|
create_thin_pool
(name=None, size_str=None)¶Creates a thin provisioning pool for this VG.
The syntax here is slightly different than the default lvcreate -T, so we’ll just write a custom cmd here and do it.
Parameters: |
|
---|---|
Returns: | The size string passed to the lvcreate command |
create_volume
(name, size_str, lv_type='default', mirror_count=0)¶Creates a logical volume on the object’s VG.
Parameters: |
|
---|
deactivate_lv
(name)¶delete
(name)¶Delete logical volume or snapshot.
Parameters: | name – Name of LV to delete |
---|
extend_volume
(lv_name, new_size)¶Extend the size of an existing volume.
get_all_physical_volumes
(root_helper, vg_name=None)¶Static method to get all PVs on a system.
Parameters: |
|
---|---|
Returns: | List of Dictionaries with PV info |
get_all_volume_groups
(root_helper, vg_name=None)¶Static method to get all VGs on a system.
Parameters: |
|
---|---|
Returns: | List of Dictionaries with VG info |
get_lv_info
(root_helper, vg_name=None, lv_name=None)¶Retrieve info about LVs (all, in a VG, or a single LV).
Parameters: |
|
---|---|
Returns: | List of Dictionaries with LV info |
get_lvm_version
(root_helper)¶Static method to get LVM version from system.
Parameters: | root_helper – root_helper to use for execute |
---|---|
Returns: | version 3-tuple |
get_volume
(name)¶Get reference object of volume specified by name.
Returns: | dict representation of Logical Volume if exists |
---|
get_volumes
(lv_name=None)¶Get all LV’s associated with this instantiation (VG).
Returns: | List of Dictionaries with LV info |
---|
lv_get_origin
(name)¶Return the origin of an LV that is a snapshot, None otherwise.
lv_has_snapshot
(name)¶lv_is_open
(name)¶Return True if LV is currently open, False otherwise.
lv_is_snapshot
(name)¶Return True if LV is a snapshot, False otherwise.
rename_volume
(lv_name, new_name)¶Change the name of an existing volume.
revert
(snapshot_name)¶Revert an LV to snapshot.
Parameters: | snapshot_name – Name of snapshot to revert |
---|
supports_lvchange_ignoreskipactivation
¶Property indicating whether lvchange can ignore skip activation.
Check for LVM version >= 2.02.99. (LVM2 git: ab789c1bc add –ignoreactivationskip to lvchange)
supports_pvs_ignoreskippedcluster
(root_helper)¶Property indicating whether pvs supports –ignoreskippedcluster
Check for LVM version >= 2.02.103. (LVM2 git: baf95bbff cmdline: Add –ignoreskippedcluster.
supports_snapshot_lv_activation
¶Property indicating whether snap activation changes are supported.
Check for LVM version >= 2.02.91. (LVM2 git: e8a40f6 Allow to activate snapshot)
Returns: | True/False indicating support |
---|
supports_thin_provisioning
(root_helper)¶Static method to check for thin LVM support on a system.
Parameters: | root_helper – root_helper to use for execute |
---|---|
Returns: | True if supported, False otherwise |
update_volume_group_info
()¶Update VG info for this instantiation.
Used to update member fields of object and provide a dict of info for caller.
Returns: | Dictionaries of VG info |
---|
vg_mirror_free_space
(mirror_count)¶vg_mirror_size
(mirror_count)¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.