lvol - Configure LVM logical volumes

Author:Jeroen Hoekx

Synopsis

New in version 1.1.

This module creates, removes or resizes logical volumes.

Options

parameter required default choices comments
force no no
  • yes
  • no
Shrink or remove operations of volumes requires this switch. Ensures that that filesystems get never corrupted/destroyed by mistake. (added in Ansible 1.5)
lv yes
    The name of the logical volume.
    size no
      The size of the logical volume, according to lvcreate(8) --size, by default in megabytes or optionally with one of [bBsSkKmMgGtTpPeE] units; or according to lvcreate(8) --extents as a percentage of [VG|PVS|FREE]; resizing is not supported with percentages.
      state no present
      • present
      • absent
      Control if the logical volume exists.
      vg yes
        The volume group this logical volume is part of.

        Examples


        # Create a logical volume of 512m.
        - lvol: vg=firefly lv=test size=512
        
        # Create a logical volume of 512g.
        - lvol: vg=firefly lv=test size=512g
        
        # Create a logical volume the size of all remaining space in the volume group
        - lvol: vg=firefly lv=test size=100%FREE
        
        # Extend the logical volume to 1024m.
        - lvol: vg=firefly lv=test size=1024
        
        # Reduce the logical volume to 512m
        - lvol: vg=firefly lv=test size=512 force=yes
        
        # Remove the logical volume.
        - lvol: vg=firefly lv=test state=absent force=yes
        

        Note

        Filesystems on top of the volume are not resized.

        Table Of Contents

        Previous topic

        lvg - Configure LVM volume groups

        Next topic

        modprobe - Add or remove kernel modules