Clean up and remove a project completely

Delete all resources in a project and remove the project.

Before you begin

  • The administrator has created a project for you and has provided you with a clouds.yaml file for you to access the cloud.
  • The python-openstackclient package is on your workstation.
    $ dnf list installed python-openstackclient

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. Using the project name, delete the project and all of the resources associated with the project:
    Example

    In this example, test-project is deleted:

    $ openstack project purge --project test-project

Results

  • Confirm that the project has been deleted:
    $ openstack project list
    Sample output
    +----------------------------------+--------------+
    | ID                               | Name         |
    +----------------------------------+--------------+
    | 519e6344f82e4c079c8e2eabb690023b | services     |
    | 80bf5732752a41128e612fe615c886c6 | demo         |
    | 98a2f53c20ce4d50a40dac4a38016c69 | admin        |
    +----------------------------------+--------------+