Deleting an instance

To complete the life cycle of an instance, you will need to delete it. Nova provides a facility for this, using the openstack command-line tool.

Getting ready

To delete an instance, you will need the following:

  • The openstack command-line client
  • The openrc file containing appropriate credentials
  • The name of the instance

How to do it…

In this example, we will be deleting the cookbook.test instance created in the Booting an instance recipe used for booting. To delete the instance, use the following steps:

  1. First, list the running instances:
    openstack server list
    
    How to do it…
  2. To delete the instance named cookbook.test, issue the following command:

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.