Resource Cleanup in OpenStack Flex

OpenStack Flex Resource Deletion Order

Deleting OpenStack resources in the right order prevents dependency errors (like “resource in use”) and ensures a clean teardown. We've provided an ordered sequence below which will ensure you're efficiently deleting and cleaning up resources top to bottom without running into errors relating to dependency.

Recommended Deletion Order

1. Instances (Compute)

  • Delete all Instances first.
  • Instances depend on networks, ports, security groups, keypairs, and volumes.

2. Block Storage (Cinder)

  • Includes Volumes, Snapshots, and Backups.
  • Delete anything unwanted after all instances are gone and any unwanted volumes are detached.

3. Floating IPs

  • Use the Release option to delete any unwanted Floating IPs.

4. Routers (Neutron)

  • Close the External Gateway, Disconnect the Subnet, and then issue a deletion for an unwanted Router.
  • Routers must be gone before networks can be deleted.

5. Ports

  • Delete up any unwanted Ports (e.g., orphaned after instance or router removal).

6. Networks

  • Remove after all subnets and ports are gone.

7. Security Groups

  • Delete only custom ones; the default group can remain.

8. Images (Glance)

  • Remove any unwanted custom Images once all dependent instances are gone.

9. Key Manager

  • Optional cleanup. Certificates and Keypairs are independent of other resources.

10. Other Services

  • Delete any remaining unwanted resources from optional services:

    • Key Manager (Secrets and Certificates)
    • Key Pairs (Compute)
    • Orchestration Stacks (Heat)
    • Application Credentials (User Center)
    • Object Storage (Swift)

NOTE: When deleting Object Storage files and folders - you must empty each folder of objects before being able to remove the parent directory. You must empty the container entirely to delete the container.