Discards for LVM Level Thin Provisioning

OnApp offers the configuration of Logical Volume Management version 2 (LVM2) on OnApp compute resources or Backup Servers to support LVM discards. For that purpose, LVM has a configuration option called issue_discards. By default this option is disabled (i.e. set to 0).

After enabling this option:

  • LVM will issue discards to physical extents (PEs) that are no longer used by a logical volume (LVs).
  • Discards are then sent to an LV's underlying physical volumes when the LV is no longer using the physical volumes' space, e.g. after lvremove or lvreduce command invocation.
  • Discards inform the storage that a region is no longer used.
  • Storage that supports discards advertises the protocol-specific way discards should be issued by the kernel (TRIM, UNMAP, or WRITE SAME with UNMAP bit set).

Requirements

  • Prepare your storage - only SSDs and thinly provisioned LUNs support discards.
  • Storage Area Network (SAN) should support issuing discards
  • The kernel to support issuing discards on CentOS6 and CentOS7 the default kernel should support this action 

Limitations

Enabling discards may cause the following issues, so performance should be monitored after enabling discards:

  1. Increased load on lower block device - disk or attached SAN. Performance hit will depend on the specific way of discards processing by the block device (SAN).
  2. IOWait could rise and potentially may slow down other VSs, which are running on that compute resource or SAN.
  3. Removing logical volumes (lvremove) and reducing its size (lvreduce) may take more time to complete.

You may wish to enable this option on one Backup Server or across a single Compute Zone before enabling the whole cloud.

Enable Discards

To enable discards:

  1. Open the /etc/lvm/lvm.conf file.

  2. Click the issue_discards line. 
  3. Change the "0" value to "1."

You can repeat this procedure on all servers where you want to have this option enabled. Reboot or restart of servers and services is not required for enabling or disabling this option.