Support for Linux LVM2
Return all version info from lvm version
CLI Example:
salt '*' lvm.fullversion
Create a new logical volume, with option for which physical volume to be used
CLI Examples:
salt '*' lvm.lvcreate new_volume_name vg_name size=10G
salt '*' lvm.lvcreate new_volume_name vg_name extents=100 pv=/dev/sdb
salt '*' lvm.lvcreate new_snapshot vg_name snapshot=volume_name size=3G
New in version 0.12.0.
Support for thin pools and thin volumes
CLI Examples:
salt '*' lvm.lvcreate new_thinpool_name vg_name size=20G thinpool=True
salt '*' lvm.lvcreate new_thinvolume_name vg_name/thinpool_name size=10G thinvolume=True
Return information about the logical volume(s)
logical device name
if the logical volume is not present, do not show any error
CLI Examples:
salt '*' lvm.lvdisplay
salt '*' lvm.lvdisplay /dev/vg_myserver/root
Increase a logical volume to specific size.
CLI Examples:
salt '*' lvm.lvextend +12M /dev/mapper/vg1-test
salt '*' lvm.lvextend lvpath=/dev/mapper/vg1-test extents=+100%FREE
Remove a given existing logical volume from a named existing volume group
CLI Example:
salt '*' lvm.lvremove lvname vgname force=True
Resize a logical volume to specific size.
CLI Examples:
salt '*' lvm.lvresize +12M /dev/mapper/vg1-test
salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE
Set a physical device to be used as an LVM physical volume
Skip devices, if they are already LVM physical volumes
CLI Examples:
salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2
salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
Return information about the physical volume(s)
physical device name
dereference any symlinks and report the real device
New in version 2015.8.7.
if the physical volume is not present, do not show any error
CLI Examples:
salt '*' lvm.pvdisplay
salt '*' lvm.pvdisplay /dev/md0
Remove a physical device being used as an LVM physical volume
Skip devices, if they are already not used as LVM physical volumes
CLI Examples:
salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2
Resize a LVM physical volume to the physical device size
Skip devices, if they are already not used as LVM physical volumes
CLI Examples:
salt mymachine lvm.pvresize /dev/sdb1,/dev/sdb2
Return LVM version from lvm version
CLI Example:
salt '*' lvm.version
Create an LVM volume group
CLI Examples:
salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2
salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
Return information about the volume group(s)
volume group name
if the volume group is not present, do not show any error
CLI Examples:
salt '*' lvm.vgdisplay
salt '*' lvm.vgdisplay nova-volumes
Add physical volumes to an LVM volume group
CLI Examples:
salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2
salt mymachine lvm.vgextend my_vg /dev/sdb1
Remove an LVM volume group
CLI Examples:
salt mymachine lvm.vgremove vgname
salt mymachine lvm.vgremove vgname force=True