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
openstackcommand-line clientThe
openrcfile containing appropriate credentialsThe 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:
First, list the running instances:
openstack server list
To delete the instance named
cookbook.test, issue the following command:openstack server delete cookbook.testNote
This command produces no output when successful.
Now list the instances again to confirm the deletion:
openstack server listThis will bring back an output, where the instance we have deleted is now not present:

How it works…
The openstack server delete command, unlike suspending or shelving an instance, deletes...