Pcornel
Automation · Storage Automation

LVM Automation

Cheat sheet · https://pcornel.dk/topic.php?topic=5747

Back to the Topic

Answer

LVM automation creates and extends physical volumes, volume groups and logical volumes with pvcreate, vgextend and lvextend -r, or Ansible's lvg and lvol modules, growing file systems online.

Remember

  • pvcreate, vgextend and lvextend -r manage LVM.
  • Ansible lvg and lvol modules are idempotent.
  • Check free space first.

First checks

  • ansible <h> -m community.general.lvol -a 'vg=<vg> lv=<lv> size=+10G resizefs=true' --check — extend
  • lvs; vgs — state
  • VG free check — capacity

Verify in this order

check free → extend LV → resize FS → verify

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5747

Confirmation

Confirm action

Continue?