Cloned from launchpad blueprint https://blueprints.launchpad.net/cinder/+spec/verifying-cinder-quota-usage.
Cinder maintains a table called quota_usage in the Cinder db to record the number of volumes and their sizes that are used by each tenant. This record is used for the quota verification of the tenant. It is relatively slow to count all the volumes owned by the tenant, sum up the volume sizes and populate this record in scale and there are chances that this record may not match with what the tenant is actually using when there are coding errors in Cinder or there is constant create, update or delete of volumes in the tenant.
We are suggesting a tool or a script outside Cinder that counts all the volumes owned by each and every tenant and also sums up their sizes to verify if the quota usage record for the respective tenant is correct in the table. Given that the script can find quota problems before the limit is hit it should make debugging much easier, especially in scale.
Specification URL (additional information):