lvg – Configure AIX LVM volume groups

Synopsis

This module creates, removes, modifies attributes, resizes, activates and deactivates volume groups.

Requirements

The below requirements are needed on the host that executes this module.

  • AIX >= 7.1 TL3

  • Python >= 2.7

  • Privileged user with authorizations: aix.lvm.manage.extend,aix.lvm.manage.change,aix.lvm.manage.create,aix.lvm.manage.remove

Parameters

state (optional, str, present)

Specifies the action to be performed on a volume group. present creates, extends or modifies a volume group; absent reduces or removes a volume group; varyon activates a volume group performing a varyon operation; varyoff deactivates a volume group performing a varyoff operation.

vg_name (True, str, None)

Specifies the volume group name.

vg_type (optional, str, None)

Specifies the type of the volume group.

Can be used when creating or changing a volume group, hence when state=present.

enhanced_concurrent_vg (optional, bool, None)

Specifies Enhanced Concurrent Capable volume group.

Cannot be used on volume groups and systems that do not use the PowerHA SystemMirror enhanced scalability (ES) product.

Can be used when creating or changing a volume group, hence when state=present.

critical_vg (optional, bool, None)

Enables the Critical VG option of the volume group.

Can be used when creating or changing a volume group, hence when state=present.

pvs (optional, list, None)

Specifies the list of physical volumes.

When state=present and the VG exists, adds the PVs to the existing VG; otherwise creates the VG with the PVs.

When state=absent, removes the PVs from the VG.

Can be used when state=present or state=absent.

critical_pvs (optional, bool, None)

Specifies the Critical PVs option for the volume group. If write request failures occur in the mirrored logical volume, the PV is marked as missing and it stops sending I/O requests to the failed mirrored logical volume.

Available only in IBM AIX 7.2 with Technology Level 1, or later.

Can be used when creating or changing a volume group, hence when state=present.

num_lvs (optional, int, None)

Number of logical volumes that can be created.

Can be used with vg_type=scalable volume groups.

Can be used when creating or changing a volume group, hence when state=present.

delete_lvs (optional, bool, None)

Deallocates existing logical volume partitions and then deletes resultant empty logical volumes from the specified physical volumes.

Attention: using delete_lvs=yes automatically deletes all logical volume data on the physical volume before removing the physical volume from the volume group. If a logical volume spans multiple physical volumes, the removal of any of those physical volumes may jeopardize the integrity of the entire logical volume.

Can be used when state=absent.

num_partitions (optional, int, None)

Total number of units of 1024 partitions in the volume group.

Can be used with vg_type=scalable volume groups.

Default when not set is 32 hence 32k (32768 partitions).

Can be used when creating or changing a volume group, hence when state=present.

pp_size (optional, int, None)

Sets physical partition size expressed in units of megabytes from 1 (1 MB) through 131072 (128 GB). It must be equal to a power of 2 (example 1, 2, 4, 8).

The default value for 32 and 128 PV volume groups is the lowest value to remain within the limitation of 1016 physical partitions per PV.

The default value for scalable volume groups is the lowest value to accommodate 2040 physical partitions per PV.

Can be used when creating a volume group, hence when state=present.

pp_limit (optional, int, None)

Changes the limit of the number of physical partitions per physical volume.

The maximum number of physical partitions per physical volume for this volume group changes to pp_limit x 1016.

It must be 1 - 16 for 32 PV volume groups and 1 and 64 for 128 PV volume groups.

The maximum number of PVs that can be included in the volume group is MaxPVs / pp_limit.

The default is the lowest value to remain within the physical partition limit of pp_limit x 1016.

Can be used when creating or changing a volume group, hence when state=present.

force (optional, bool, None)

When state=present, forces the volume group to be created on the specified physical volume unless the physical volume is part of another volume group in the Device Configuration Database or a volume group that is active.

Can be used when creating or changing a volume group, hence when state=present. Discaded when state=absent.

mirror_pool (optional, str, None)

Specifies the mirror pool name to assigns the physical volumes to.

After mirror pools are enabled in a volume group, the volume group can no longer be imported into a version of AIX that does not support mirror pools.

Can be used only when creating/extending a volume group, hence when state=present.

Mirror pools are only defined for vg_type=scalable type volume group.

mirror_pool_strict (optional, str, None)

Enables mirror pool strictness for the volume group.

none specifies that no restrictions are placed on the user of mirror pool.

normal specifies that mirror pools must be used on each logical volume in the volume group.

strict specifies that super-strict mirror pools are enforced on this volume group. Partitions allocated for one mirror cannot share a physical volume with the partitions from another mirror; with this setting each mirror pool must contain at least one copy of each logical volume.

Can be used when creating or changing a volume group, hence when state=present.

multi_node_vary (optional, bool, None)

Specified that the volume group is allowed to varyon in non-concurrent mode in more than one node at the same time or not. This is the default behavior.

This option is not available for volume groups varied on in the concurrent mode.

This VG can no longer be imported on a version of AIX that does not support this flag.

When multi_node_vary=no the VG can no longer be imported on a version of AIX that does not support this mode.

Can be used when creating or changing a volume group, hence when state=present.

auto_on (optional, bool, None)

Specifies that the volume group is automatically available during a system restart.

By default auto_on=yes when creating a volume group.

Can be used when creating or changing a volume group, hence when state=present.

retry (optional, bool, None)

Enables the infinite retry option of the logical volume.

When (retry=no), a failing I/O of the logical volume is not retried. This is the default behavior.

When (retry=yes), a failed I/O request is retried until it is successful.

major_num (optional, int, None)

Specifies the major number of the volume group that is created.

Can be used only when creating a volume group, hence when state=present.

quorum (optional, bool, None)

Enables/disables quorum on the volume group.

Can be used while changing an existing volume group, hence when state=present.

Notes

Note

Examples

- name: Create a scalable volume group with a mirror pool
  ibm.power_aix.lvg:
    state: present
    vg_name: datavg
    pvs: hdisk1
    vg_type: scalable
    mirror_pool: mp1

- name: Create a volume group with multiple physical volumes
  ibm.power_aix.lvg:
    state: present
    vg_name: datavg
    pvs: hdisk1 hdisk2 hdisk3

- name: Extend a volume group
  ibm.power_aix.lvg:
    state: present
    vg_name: datavg
    pvs: hdisk1

- name: Remove a volume group
  ibm.power_aix.lvg:
    state: absent
    vg_name: datavg

- name: Removing hdisk1 and hdisk2 physical volumes from a volume group
  ibm.power_aix.lvg:
    state: absent
    vg_name: datavg
    pvs: hdisk1 hdisk2

- name: Varyon a volume group
  ibm.power_aix.lvg:
    vg_name: datavg
    state: varyon

- name: Varyoff a volume group
  ibm.power_aix.lvg:
    state: varyoff
    vg_name: datavg

Return Values

msg (always, str, Volume group ‘rootvg’ activated.)

The execution message.

cmd (always, str, )

The command executed.

rc (When the command is executed., int, )

The command return code.

stdout (always, str, datavg)

The standard output of the command.

stderr (always, str, 0516-321 mkvg: Physical volume rootvg is not configured.n 0516-306 mkvg: Unable to find physical volume hdisk3 in the Device Configuration Database.n 0516-862 mkvg: Unable to create volume group.)

The standard error of the command.

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by community.

Authors

  • AIX Development Team (@pbfinley1911)