Deleting volumes

At some point, you will no longer need the volumes you have created. To remove the volumes from the system permanently, so they are no longer available, we simply pull out another tool from the OpenStack client, the volume delete option.

Getting ready

To delete a volume, you will need the following:

  • The openstack command-line client
  • An openrc file with appropriate credentials for the environment
  • The name or ID of the volume to delete

For our example, these values are as follows:

  • Volume: cookbook.volume

Tip

Warning: This will remove the volume and any data stored on it, so ensure that this is the correct action you want to perform before continuing.

You can only delete a volume that isn't currently attached to an instance.

How to do it… ...

Get OpenStack Cloud Computing Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.