How to calculate the block storage usage in Openstack
Problem
- How to calculate the block storage usage, free/total capacity, and oversubscription ratio using OpenStack Cinder metrics.
This article explains how to calculate the block storage usage from cinder get-pools --detail
in OpenStack. It is applicable for any Cinder backend (e.g., Ceph, HPE 3PAR, NetApp, etc.) and helps you interpret key metrics related to block storage usage, provisioning, and backend status.
Environment
- Platform9 Managed OpenStack - v4.0 and Higher
- Cinder
Key Terms
Term | Description |
---|---|
Total Capacity | Physical capacity of the backend storage. |
Allocated Capacity | Actual space used on the backend storage (physical usage). |
Free Capacity | Unused portion of physical storage. |
Provisioned Capacity | Total logical volume size requested by users. May exceed physical space if thin provisioning is used. |
Oversubscription Ratio | How much logical capacity is provisioned relative to what's physically used. |
Max Oversubscription Ratio | Configured upper limit of how much Cinder is allowed to oversubscribe the backend. |
Answer
- Source admin.rc file.
$ source admin.rc
- Run below command to list all the available cinder pools.
$ cinder get-pools --detail
- Example output for Cinder with Ceph as backend storage.
x
$ cinder get-pools --detail
+-----------------------------+-------------------------------------------------------------------+
| Property | Value |
+-----------------------------+-------------------------------------------------------------------+
| allocated_capacity_gb | 3132 |
| backend_state | up |
| driver_version | [VERSION] |
| filter_function | None |
| free_capacity_gb | 36527.21 |
| goodness_function | None |
| location_info | [LOCATION_INFO] |
| max_over_subscription_ratio | 20.0 |
| multiattach | True |
| name | [CINDER_POOL_NAME] |
| provisioned_capacity_gb | 4532 |
| replication_enabled | False |
| reserved_percentage | 0 |
| storage_protocol | ceph |
| thin_provisioning_support | True |
| timestamp | [TIMESTAMP] |
| total_capacity_gb | 103680.78 |
| vendor_name | Open Source |
| volume_backend_name | ceph1 |
+-----------------------------+-------------------------------------------------------------------+
.. more
Calculations
- Allocated Capacity (Physical Usage)
total_allocated_capacity_gb = sum of allocated_capacity_gb of all cinder pools
- Provisioned Capacity (Logical Usage)
total_provisioned_capacity_gb = sum of provisioned_capacity_gb of all cinder pools
- Oversubscription Ratio (Actual)
oversubscription_ratio = total_provisioned_capacity_gb / total_allocated_capacity_gb
- Free and Total Capacity
- If all the cinder pools use same backend storage pool.
grand_total_capacity_gb = total_capacity_gb of any one pool
total_free_capacity_gb = free_capacity_g of any one pool
- If cinder pools use different backend storage pools.
grand_total_capacity_gb = sum of total_capacity_gb of all pools
total_free_capacity_gb = sum of free_capacity_gb of all pools
- Maximum Provisioned Capacity Allowed
max_allowed_provisioned_capacity = grand_total_capacity_gb × max_over_subscription_ratio
Was this page helpful?