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

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

About DataVolumes

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

Listing all DataVolumes

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

Procedure
  • List all DataVolumes by running the following command:

    $ oc get dvs

Deleting a DataVolume

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

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

Procedure
  • Delete the DataVolume 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.