Finding and cleaning stale subvolumes

This section describes how to find and clean stale subvolumes.

Before you begin

Important: Deleting stale subvolumes using the ODF CLI tool is a Technology Preview feature and is subject to Technology Preview limitations.

Download the OpenShift Data Foundation command-line interface (CLI) tool. With the Data Foundation CLI tool, you can effectively manage and troubleshoot your Data Foundation environment from a terminal. To get a compatible version and download the CLI tool, see customer portal.

About this task

Sometimes stale subvolumes do not have a respective k8s reference attached. These subvolumes are of no use and can be deleted. You can find and delete stale subvolumes using the ODF CLI tool.

Procedure

  1. Find the stale subvolumes by using the --stale flag with the subvolume command:
     odf subvolume ls --stale

    Example output:

    # Filesystem  Subvolume Subvolumegroup State
    # ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110004 csi stale
    # ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110005 csi stale
  2. Delete the stale subvolumes:
     odf subvolume delete <subvolumes> <filesystem> <subvolumegroup>

    Replace <subvolumes> with a comma separated list of subvolumes from the output of the first command. The subvolumes must be of the same filesystem and subvolumegroup.

    Replace <filesystem> and <subvolumegroup> with the filesystem and subvolumegroup from the output of the first command.

    Example:

     odf subvolume delete csi-vol-427774b4-340b-11ed-8d66-0242ac110004,csi-vol-427774b4-340b-11ed-8d66-0242ac110005 ocs-storagecluster csi

    Example output:

    # Info: subvolume csi-vol-427774b4-340b-11ed-8d66-0242ac110004 deleted
    # Info: subvolume csi-vol-427774b4-340b-11ed-8d66-0242ac110004 deleted