community.general.lvm_pv_move_data module – Move data between LVM Physical Volumes (PVs)

Note

This module is part of the community.general collection (version 11.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.lvm_pv_move_data.

New in community.general 11.2.0

Synopsis

  • Moves data from one LVM Physical Volume (PV) to another.

Requirements

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

  • LVM2 utilities

  • Both source and destination devices must exist, and the PVs must be in the same volume group.

  • The destination PV must have enough free space to accommodate the source PV’s allocated extents.

  • Verbosity is automatically controlled by Ansible’s verbosity level (using multiple -v flags).

Parameters

Parameter

Comments

atomic

boolean

Makes the pvmove operation atomic, ensuring that all affected LVs are moved to the destination PV, or none are if the operation is aborted.

Choices:

  • false

  • true ← (default)

auto_answer

boolean

Answer yes to all prompts automatically.

Choices:

  • false ← (default)

  • true

autobackup

boolean

Automatically backup metadata before changes (strongly advised!).

Choices:

  • false

  • true ← (default)

destination

path / required

Path to the destination block device to move data to.

Must be an existing PV with enough free space.

source

path / required

Path to the source block device to move data from.

Must be an existing PV.

Examples

- name: Moving data from /dev/sdb to /dev/sdc
  community.general.lvm_pv_move_data:
    source: /dev/sdb
    destination: /dev/sdc

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

List of actions performed during module execution.

Returned: success

Sample: ["moved data from /dev/sdb to /dev/sdc", "no allocated extents to move", "would move data from /dev/sdb to /dev/sdc"]

Authors

  • Klention Mali (@klention)