Reclaiming space on target volumes

Reclaim the actual available storage space on target volumes.

The deleted files or chunks of zero data sometimes take up storage space on the Ceph cluster resulting in inaccurate reporting of the available storage space. The reclaim space operation removes such discrepancies by executing the following operations on the target volume:

  • fstrim - This operation is executed on volumes that are in Filesystem mode and only if the volume is mounted to a pod at the time of execution of reclaim space operation.
  • rbd sparsify - This operation is executed when the volume is not attached to any pods and reclaims the space occupied by chunks of 4M-sized zeroed data.
Note:
  • The reclaim space operation is supported only by the Ceph RBD volumes.
  • The reclaim space operation involves a performance penalty when it is being executed.

You can use one of the following methods to reclaim the space:

  • Enabling reclaim space operation using Annotating PersistentVolumeClaims (Recommended method to use for enabling reclaim space operation)
  • Enabling reclaim space operation using ReclaimSpaceJob
  • Enabling reclaim space operation using ReclaimSpaceCronJob