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 clientThe
openrc
file 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.test
Note
This command produces no output when successful.
Now list the instances again to confirm the deletion:
openstack server list
This 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...