×

You can manually delete a data volume by using the oc command-line interface.

When you delete a virtual machine, the data volume it uses is automatically deleted.

About data volumes

DataVolume objects are custom resources that are provided by the Containerized Data Importer (CDI) project. Data volumes orchestrate import, clone, and upload operations that are associated with an underlying persistent volume claim (PVC). Data volumes are integrated with OKD Virtualization, and they prevent a virtual machine from being started before the PVC has been prepared.

Listing all data volumes

You can list the data volumes in your cluster by using the oc command-line interface.

Procedure
  • List all data volumes by running the following command:

    $ oc get dvs

Deleting a data volume

You can delete a data volume by using the oc command-line interface (CLI).

Prerequisites
  • Identify the name of the data volume that you want to delete.

Procedure
  • Delete the data volume by running the following command:

    $ oc delete dv <datavolume_name>

    This command only deletes objects that exist in the current project. Specify the -n <project_name> option if the object you want to delete is in a different project or namespace.