Viewing Per-Tenant Block Storage Usage in OpenStack

Problem

How to retrieve per-tenant (project-wise) block storage usage in OpenStack using CLI, including total provisioned volume size summaries.

Info

There's no direct openstack CLI command that gives tenant-wise volume size summary.

Environment

  • Platform9 Managed OpenStack - All Versions

  • Cinder

Procedure

  1. Install SDK.

$ pip3 install openstacksdk
  1. Export admin.rc file.

$ source admin.rc
  1. Script: Per-Tenant Provisioned Storage Usage.

import openstack

conn = openstack.connect()

# Build a map of project_id -> project name
project_names = {p.id: p.name for p in conn.identity.projects()}

usage = {}

# Collect provisioned volume sizes
for 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 output
print(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}")
  1. Run the Script.

$ python3 volume_usage_by_project.py
  • Sample output:

$ python3 volume_usage_by_project.py

Project Provisioned (GB)
admin 320
services 150
demo 200

Additional 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.