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:
    openstack server delete cookbook.test
    

    Tip

    This command produces no output when successful.

  3. 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 to do it…

How it works…

The openstack server delete command, unlike suspending or shelving an instance, deletes the instance and all data within it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.50.188