Bug 1041682

Summary: [RFE][cinder]: Add support to get usage information in limits API
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: RFEsAssignee: RHOS Maint <rhos-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: markmc, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/cinder/+spec/add-volume-usages-to-limits
Whiteboard: upstream_milestone_none upstream_status_started upstream_definition_obsolete
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-19 17:23:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description RHOS Integration 2013-12-12 18:37:50 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/cinder/+spec/add-volume-usages-to-limits.

Description:

Cinder maintains current quota usages of each tenant in quota_usages db table. There is logic to calculate "gigabytes" used for both volumes and snapshots,
and the quotas api in cinder gives information of current usages for a particular tenant. 
But, this api is implemented as a cinder extension and there is a possibility that a service provider may not deploy this extension in their environment. In that case horizon will fail to show the usages, which was why horizon replaced quota apis with limit apis across all screens (in bug https://bugs.launchpad.net/horizon/+bug/1178694).

One way to tackle this problem is to enhance the limits API to include usage information in the response, as follows:

A)
 
{
    "limits": {
        "rate": [], 
        "absolute": {
            "maxTotalVolumeGigabytes": 1000,
            "maxTotalVolumes": 10,
            "totalGigabytes" : 50,
            "totalSnapshots": 6,
            "totalVolumes": 3
          }
    }
}

or 

B)
{
    "limits": {
        "rate": [],
        "absolute": {
            "maxTotalVolumeGigabytes": 1000,
            "maxTotalVolumes": 10
        },
        "usages" : {
            "totalGigabytes" : 50,
            "totalSnapshots": 6,
            "totalVolumes": 3
       } 
    }
}

option A) ensures consistency across openstack services while option B) seems ideal to separate out absolute and usage
figures.

Specification URL (additional information):

None