Page MenuHomePhabricator

Cinder API no longer provides used quotas to novaobserver/openstack-browser
Closed, ResolvedPublic

Description

Cinder no longer shows used quotas, the response novaobserver gets with python-cinderclient only has the allocated quotas:

{'eqiad1-r': {'rate': [], 'absolute': {'maxTotalVolumes': 8, 'maxTotalSnapshots': 4, 'maxTotalVolumeGigabytes': 80, 'maxTotalBackups': 0, 'maxTotalBackupGigabytes': 1000}}}

It worked when I originally configured openstack-browser to display that, I believe we were running openstack train back then.

Event Timeline

I can't entirely tell when this changed, but there's a 'usage' flag you can pass in to the query that gets usage:

>>> cinder.quotas.get('testlabs')
<QuotaSet backup_gigabytes=1000, backups=0, gigabytes=50, gigabytes___DEFAULT__=-1, gigabytes_standard=-1, groups=4, per_volume_gigabytes=-1, snapshots=4, snapshots___DEFAULT__=-1, snapshots_standard=-1, volumes=8, volumes___DEFAULT__=-1, volumes_standard=-1>
>>>
>>> cinder.quotas.get('testlabs', usage=True)
<QuotaSet backup_gigabytes={'limit': 1000, 'in_use': 0, 'reserved': 0, 'allocated': 0}, backups={'limit': 0, 'in_use': 0, 'reserved': 0, 'allocated': 0}, gigabytes={'limit': 50, 'in_use': 34, 'reserved': 0, 'allocated': 0}, gigabytes___DEFAULT__={'limit': -1, 'in_use': 0, 'reserved': 0, 'allocated': 0}, gigabytes_standard={'limit': -1, 'in_use': 34, 'reserved': 0, 'allocated': 0}, groups={'limit': 4, 'in_use': 0, 'reserved': 0, 'allocated': 0}, per_volume_gigabytes={'limit': -1, 'in_use': 0, 'reserved': 0, 'allocated': 0}, snapshots={'limit': 4, 'in_use': 0, 'reserved': 0, 'allocated': 0}, snapshots___DEFAULT__={'limit': -1, 'in_use': 0, 'reserved': 0, 'allocated': 0}, snapshots_standard={'limit': -1, 'in_use': 0, 'reserved': 0, 'allocated': 0}, volumes={'limit': 8, 'in_use': 2, 'reserved': 0, 'allocated': 0}, volumes___DEFAULT__={'limit': -1, 'in_use': 0, 'reserved': 0, 'allocated': 0}, volumes_standard={'limit': -1, 'in_use': 2, 'reserved': 0, 'allocated': 0}>
>>>

Does that get you want you need?

Yeah, that works. Thanks!