Cookbooks
lvm
documentation
Lvm Volume Group

lvm_volume_group

Back to resource list

Manages LVM volume groups.

Actions

ActionDescription
:create(default) Creates a new volume group
:extendExtend an existing volume group to include new physical volumes

Properties

NameTypeDefaultDescription
nameStringname property(required) Name of the volume group
physical_volumesArray, String(required) The device or list of devices to use as physical volumes (if they haven't already been initialized as physical volumes, they will be initialized automatically)
physical_extent_sizeStringnilThe physical extent size for the volume group
logical_volumeProcnilShortcut for creating a new lvm_logical_volume definition (the logical volumes will be created in the order they are declared)
wipe_signaturestrue, falsefalseForce the creation of the Volume Group, even if lvm detects existing non-LVM data on disk
thin_poolProcnilShortcut for creating a new lvm_thin_pool definition (the logical volumes will be created in the order they are declared)

Examples

lvm_volume_group 'vg00' do
  physical_volumes ['/dev/sda', '/dev/sdb', '/dev/sdc']
  wipe_signatures true
 
  logical_volume 'logs' do
    size        '1G'
    filesystem  'xfs'
    mount_point location: '/var/log', options: 'noatime,nodiratime'
    stripes     3
  end
 
  logical_volume 'home' do
    size        '25%VG'
    filesystem  'ext4'
    mount_point '/home'
    stripes     3
    mirrors     2
  end
 
  thin_pool "lv-thin-pool" do
    size '5G'
    stripes 2
 
    thin_volume "thin01" do
      size '10G'
      filesystem  'ext4'
      mount_point location: '/var/thin01', options: 'noatime,nodiratime'
    end
  end
end