Small helper scripts for OpenStack administration.
- Python 3.10+
- OpenStack credentials in the usual
OS_*environment variables openstacksdkforopenstack-domain-quota-usage.py- OpenStack CLI for
openstack-image-share.pyandopenstack-project-cleanup.py
pip install -r requirements.txtSummarizes quota usage across projects in a domain: cores, RAM in GiB, and volume storage in TiB.
source openrc.sh
python3 openstack-domain-quota-usage.pyUseful options:
python3 openstack-domain-quota-usage.py --workers 4
python3 openstack-domain-quota-usage.py --limit-cores 400 --limit-ram 800 --limit-storage 20Domain/project selection uses OS_DOMAIN_ID, OS_DOMAIN_NAME, OS_PROJECT_DOMAIN_NAME, or OS_USER_DOMAIN_NAME.
Accepts a shared Glance image across visible projects. With --add-image, also runs openstack image add project before accepting, which requires authenticating as the image owner.
source openrc.sh
python3 openstack-image-share.py IMAGE_ID
python3 openstack-image-share.py --add-image IMAGE_IDLists project resources and prompts before deleting each group:
- Deletes servers, volumes, floating IPs, routers, ports, networks, then the
ssh_keykeypair. - Detaches router interfaces before deleting routers.
- Skips networks named
public; only internal, vxlan, non-shared networks are eligible.
source openrc.sh
python3 openstack-project-cleanup.py PROJECT_NAMERun any script with --help for all options.