Delete a volume

Delete volumes that you no longer need to free up storage resources and avoid exceeding your project’s volume quota limit. Staying within quota limits ensures that you can create new volumes when needed. Deleting unused volumes helps optimize resource allocation.

About this task

Note
You normally cannot delete a volume if it has existing snapshots, unless you use the --purge option.

Procedure

  1. Access the remote shell for the openstackclient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. Delete a volume.
    $ openstack volume delete \
    [--force | --purge] \
    <volume>
    • Optional:
      • Either choose the --force option when deleting a volume, to override any normal volume checks such as whether the volume is in use or not.
      • Or choose the --purge option when deleting a volume, to also delete any snapshots that have been created for this volume.
    • Replace <volume> with the name or ID of the volume that you want to remove. You can list the available volumes by using the openstack volume list command. Warning
      There is not undo action that is possible after using this command, so be sure that you are deleting the required volume.
  3. Optional: This command does not provide any confirmation that the volume has been deleted successfully. You can run the following command to list the available volumes and you should not see the volume that you have deleted:
    $ openstack volume list
  4. Exit the openstackclient pod:
    $ exit