Thin Provisioned Logical Volumes

Contents

One virtual machine for some unknown reason is utilizing thin provisioned logical volumes.  This one virtual machine is the only one in a series of virtual machines.  In any case, I didn’t understand what it meant to have a system running thin provisioned logical volumes until it crashed and I couldn’t revive it.  Fortunately, there was a snapshot that the system was reverted to so that the remediation could begin.

What are thin provisioned logical volumes?

This allows you to create logical volumes that are larger than the available extents. Using thin provisioning, you can manage a storage pool of free space, known as a thin pool, which can be allocated to an arbitrary number of devices when needed by applications. You can then create devices that can be bound to the thin pool for later allocation when an application actually writes to the logical volume. The thin pool can be expanded dynamically when needed for cost-effective allocation of storage space.  – RedHat

How to determine if the system without thin provisioned logical volumes

Using the lvs command , a typical system will look like this.

  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   centos -wi-ao----  <6.67g
  swap   centos -wi-ao---- 820.00m
  lv_app vg_app -wi-ao----  <8.00g

A system with a thin provisioned logical volume.  Not that there is a t attribute and that here is a pool

  LV            VG     Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home          centos Vwi-aotz--   1.00g pool00        1.04
  opt           centos -wi-ao----   2.48g
  pool00        centos twi-aotz--  12.00g               60.40  0.49
  root          centos Vwi-aotz--  13.00g pool00        42.13
  swap          centos -wi-ao----   1.00g
  tmp           centos -wi-ao---- 492.00m
  var           centos Vwi-aotz--   4.00g pool00        42.94
  var_log       centos Vwi-aotz--   1.00g pool00        2.01
  var_log_audit centos Vwi-aotz--   1.00g pool00        1.54

Whenever a logical volume is resized the following warnings appear.

  WARNING: Sum of all thin volume sizes (19.00 GiB) exceeds the size of thin pools (10.00 GiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full

This can be remediated by typing a command to manually resize it.  The value I selected +2G was a value I pulled out of a hat as I didn’t know of an appropriate value.  And yet, the WARNING messages continued.

lvm lvresize --poolmetadatasize +2G centos/pool00

Enable Thin LVM Automatic Extension

Edit the /etc/lvm/lvm.conf and adjust the thin_pool_autoextend_threshold valued from 100 (which disables automatic extension) to 70.  I didn’t restart any service or computer and the value took immediately.  A quick test of adding an additional 1G to / resulted in no WARNING only SUCCESS.

Source(s)

  • https://www.thegeekdiary.com/how-to-enable-thin-lvm-automatic-extension/
  • https://forum.proxmox.com/threads/is-default-install-lvm2-thin-pool-metadata-size-appropriate.31627/
  • https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/thinly_provisioned_volume_creation