lvg - Configure LVM volume groups

Author:Alexander Bulimov

Synopsis

New in version 1.1.

This module creates, removes or resizes volume groups.

Options

parameter required default choices comments
force no no
  • yes
  • no
If yes, allows to remove volume group with logical volumes.
pesize no 4
    The size of the physical extent in megabytes. Must be a power of 2.
    pvs no
      List of comma-separated devices to use as physical devices in this volume group. Required when creating or resizing volume group.
      state no present
      • present
      • absent
      Control if the volume group exists.
      vg yes
        The name of the volume group.
        vg_options no
          Additional options to pass to vgcreate when creating the volume group. (added in Ansible 1.6)

          Examples


          # Create a volume group on top of /dev/sda1 with physical extent size = 32MB.
          - lvg:  vg=vg.services pvs=/dev/sda1 pesize=32
          
          # Create or resize a volume group on top of /dev/sdb1 and /dev/sdc5.
          # If, for example, we already have VG vg.services on top of /dev/sdb1,
          # this VG will be extended by /dev/sdc5.  Or if vg.services was created on
          # top of /dev/sda5, we first extend it with /dev/sdb1 and /dev/sdc5,
          # and then reduce by /dev/sda5.
          - lvg: vg=vg.services pvs=/dev/sdb1,/dev/sdc5
          
          # Remove a volume group with name vg.services.
          - lvg: vg=vg.services state=absent

          Note

          module does not modify PE size for already present volume group

          Table Of Contents

          Previous topic

          locale_gen - Creates of removes locales.

          Next topic

          lvol - Configure LVM logical volumes