Cookbooks
lvm
documentation
Lvm Thin Pool

lvm_thin_pool

Back to resource list

Manages LVM thin pools (which are simply logical volumes created with the --thinpool argument to lvcreate).

Actions

ActionDescription
:create(default) Create a new thin pool logical volume
:resizeResize an existing thin pool logical volume (resizing only handles extending existing, this action will not shrink volumes due to the lvextend command being passed)

Properties

NameTypeDefaultDescription
nameStringname propertyName of the logical volume
groupString(required) Volume group in which to create the new volume (not required if the volume is declared inside of an lvm_volume_group block)
sizeString(required) Size of the thin pool volume, including units (k, K, m, M, g, G, t, T) or as the percentage of the size of the volume group
filesystemStringnilThe format for the file system
filesystem_paramsStringnilOptional parameters to use when formatting the file system
mount_pointString, HashnilEither a String containing the path to the mount point, or a Hash
physical_volumesString, Array[]Array of physical volumes that the volume will be restricted to
stripesIntegernilNumber of stripes for the volume
stripe_sizeIntegernilNumber of kilobytes per stripe segment (must be a power of 2 less than or equal to the physical extent size for the volume group)
mirrorsIntegernilNumber of mirrors for the volume
contiguoustrue, falsefalseWhether or not volume should use the contiguous allocation policy
readaheadInteger, StringnilThe readahead sector count for the volume (can be a value between 2 and 120, 'auto', or 'none')
take_up_free_spacetrue, falsefalsewhether to have the LV take up the remainder of free space on the VG. Only valid for resize action
thin_volumeProcnilShortcut for creating a new lvm_thin_volume definition (the volumes will be created in the order they are declared)

mount_point

If using a Hash, it must contain the following keys:

  • location - (required) the directory to mount the volume on
  • options - the mount options for the volume
  • dump - the dump field for the fstab entry
  • pass - the pass field for the fstab entry

Examples

lvm_thin_pool 'home' do
  group       'vg00'
  size        '25%VG'
  filesystem  'ext4'
  mount_point '/home'
  stripes     3
  mirrors     2
end