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.

Info

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.

$ 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 |

Calculations

  1. Allocated Capacity (Physical Usage)

total_allocated_capacity_gb = sum of allocated_capacity_gb of all cinder pools
  1. Provisioned Capacity (Logical Usage)

total_provisioned_capacity_gb = sum of provisioned_capacity_gb of all cinder pools
  1. Oversubscription Ratio (Actual)

oversubscription_ratio = total_provisioned_capacity_gb / total_allocated_capacity_gb
  1. 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
  1. Maximum Provisioned Capacity Allowed

max_allowed_provisioned_capacity = grand_total_capacity_gb × max_over_subscription_ratio