community.general.aix_lvol (8.5.0) — module

Configure AIX LVM logical volumes

Authors: Alain Dejoux (@adejoux)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module creates, removes or resizes AIX logical volumes. Inspired by lvol module.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a logical volume of 512M
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a logical volume of 512M with disks hdisk1 and hdisk2
  community.general.aix_lvol:
    vg: testvg
    lv: test2lv
    size: 512M
    pvs: [ hdisk1, hdisk2 ]
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a logical volume of 512M mirrored
  community.general.aix_lvol:
    vg: testvg
    lv: test3lv
    size: 512M
    copies: 2
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a logical volume of 1G with a minimum placement policy
  community.general.aix_lvol:
    vg: rootvg
    lv: test4lv
    size: 1G
    policy: minimum
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a logical volume with special options like mirror pool
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M
    opts: -p copy1=poolA -p copy2=poolB
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Extend the logical volume to 1200M
  community.general.aix_lvol:
    vg: testvg
    lv: test4lv
    size: 1200M
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the logical volume
  community.general.aix_lvol:
    vg: testvg
    lv: testlv
    state: absent

Inputs

    
lv:
    description:
    - The name of the logical volume.
    required: true
    type: str

vg:
    description:
    - The volume group this logical volume is part of.
    required: true
    type: str

pvs:
    default: []
    description:
    - A list of physical volumes, for example V(hdisk1,hdisk2).
    elements: str
    type: list

opts:
    default: ''
    description:
    - Free-form options to be passed to the mklv command.
    type: str

size:
    description:
    - The size of the logical volume with one of the [MGT] units.
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Control if the logical volume exists. If V(present) and the volume does not already
      exist then the O(size) option is required.
    type: str

copies:
    default: 1
    description:
    - The number of copies of the logical volume.
    - Maximum copies are 3.
    type: int

policy:
    choices:
    - maximum
    - minimum
    default: maximum
    description:
    - Sets the interphysical volume allocation policy.
    - V(maximum) allocates logical partitions across the maximum number of physical volumes.
    - V(minimum) allocates logical partitions across the minimum number of physical volumes.
    type: str

lv_type:
    default: jfs2
    description:
    - The type of the logical volume.
    type: str

Outputs

msg:
  description: A friendly message describing the task result.
  returned: always
  sample: Logical volume testlv created.
  type: str