Documentation

    PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.20

    Documentation for other releases can be found by using the version selector in the top right of any doc page.

    lvm_snapshot

    Manage LVM snapshots for backup and rollback operations.

    Attributes

    check_mode:
      support: full
    

    Parameters

    Parameter Required Type Values Description
    lv true string   Logical volume name to snapshot.
    size   string   Size of the snapshot (e.g., 5G, 512M). Required when state is present.
    snapshot_name true string   Name for the snapshot.
    state   string present
    absent
    Whether the snapshot should exist or not. [default: "present"]
    vg true string   Volume group name.

    Example

    - name: Create a snapshot of root logical volume
      lvm_snapshot:
        vg: vg0
        lv: root
        snapshot_name: root_backup
        size: 5G
    
    - name: Remove a snapshot
      lvm_snapshot:
        vg: vg0
        lv: root
        snapshot_name: root_backup
        state: absent