Managed OpenStack
Latest
Frequently Asked Questions
Solution
How To
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Viewing Per-Tenant Block Storage Usage in OpenStack
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
How to retrieve per-tenant (project-wise) block storage usage in OpenStack using CLI, including total provisioned volume size summaries.
There's no direct openstack CLI command that gives tenant-wise volume size summary.
Environment
- Platform9 Managed OpenStack - All Versions
- Cinder
Procedure
- Install SDK.
Install SDK
xxxxxxxxxx$ pip3 install openstacksdk- Export admin.rc file.
export admin.rc
xxxxxxxxxx$ source admin.rc- Script: Per-Tenant Provisioned Storage Usage.
Python Script
xxxxxxxxxximport openstack conn = openstack.connect() # Build a map of project_id -> project nameproject_names = {p.id: p.name for p in conn.identity.projects()} usage = {} # Collect provisioned volume sizesfor vol in conn.block_storage.volumes(details=True, all_projects=True): pid = vol.project_id usage[pid] = usage.get(pid, 0) + vol.size # size in GB # Print outputprint(f"{'Project':<20} {'Provisioned (GB)':>16}")for pid, size in sorted(usage.items()): name = project_names.get(pid, pid[:8]) # fallback to short ID print(f"{name:<20} {size:>16}")- Run the Script.
Bash
xxxxxxxxxx$ python3 volume_usage_by_project.py- Sample output:
bash
xxxxxxxxxx$ python3 volume_usage_by_project.py Project Provisioned (GB)admin 320services 150demo 200Additional Information
- This script reports provisioned sizes (logical volume size), not actual allocated backend usage.
- Most OpenStack backends (e.g., Ceph, LVM, HPE 3PAR, NFS) do not expose physical allocation per volume unless the driver supports it.
- Modify the script to include volume count, volume type, or export to CSV.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Next to read:
Warnings Observed During Migrations to Rocky 9.4 HostsDiscard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message