Enable deferred deletion for volumes or images with dependencies

Enable deferred deletion in the Ceph RBD Clone v2 API to delete volumes or images with dependencies. The volume or image is removed from the service but stored in a Ceph RBD trash area until dependencies are resolved. The volume or image is only deleted from Ceph RBD when there are no dependencies.

About this task

Note

The trash area maintained by deferred deletion does not provide restoration functionality. When volumes or images are moved to the trash area, they cannot be recovered or restored. The trash area serves only as a holding mechanism for the volume or image until all dependencies have been removed. The volume or image will be permanently deleted once no dependencies exist.

Limitations
  • When you enable Clone v2 deferred deletion in existing environments, the feature only applies to new volumes or images.

Procedure

  1. Verify which Ceph version the clients in your Ceph Storage cluster are running:
    $ cephadm shell -- ceph osd get-require-min-compat-client

    Example output:

    luminous
  2. To set the cluster to use the Clone v2 API and the deferred deletion feature by default, set min-compat-client to mimic. Only clients in the cluster that are running Ceph version 13.2.x (Mimic) can access images with dependencies:
    $ cephadm shell -- ceph osd set-require-min-compat-client mimic
  3. Schedule an interval for trash purge in minutes by using the m suffix:
    $ rbd trash purge schedule add --pool <pool> <30m>
    • Replace <pool> with the name of the associated storage pool, for example, volumes in the Block Storage service.
    • Replace <30m> with the interval in minutes that you want to specify for trash purge.
  4. Verify a trash purge schedule has been set for the pool:
    $ rbd trash purge schedule list --pool <pool>