This guide is for administrators, or users of an OpenStack cloud.
Install ospurge
. I have forked it to in order to haver stricter owner verification for
resources than the original.
pip3 uninstall ospurge
pip3 install git+https://github.com/knikolla/ospurge-fork
Either source your openrc
file or provide the cloud name from a clouds.yaml
using --os-cloud
.
The command to purge a project as an administrator is ospurge --purge-project <project_name>
.
It is possible to purge your own project as a user by using the command ospurge --purge-own-project
.
If you want to see the resource that are going to be deleted before performing the action, also add the option --dry-run
.
It is normal to see a warning of the type WARNING:root:2021-05-11 14:12:59,126:Can't determine owner of resource Munch
.
That is okay, ospurge
will not attempt to delete resources it can't verify and is the purpose of the fork.
ospurge --purge-project <project_name_or_id>
Note that the above will delete the resources owned from a project but not the project itself. To disable a project (as an admin) run the following command
openstack project set --disable <project_name_or_id>
It is recommended to disable projects instead of deleting them, because deleted projects are directly removed from keystone.
probably worth adding run:
pip3 install python-openstackclient