Documentation
PLEASE NOTE: This document applies to latest version and not to the latest stable release v2.21
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 |
|---|---|---|---|---|
| vg | true | string | Volume group name. | |
| lv | true | string | Logical volume name to snapshot. | |
| snapshot_name | true | string | Name for the snapshot. | |
| size | string | Size of the snapshot (e.g., 5G, 512M). Required when state is present. | ||
| state | string | present absent |
Whether the snapshot should exist or not. [default: "present"] |
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