Horizon Quotas Rework

Registered by Eric Peterson

The Horizon quota code is a mess that needs redesign. Goals should be that quotas are easy to plug and play - i.e. add and remove as needed within a deployment.

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
Low
Drafter:
Eric Peterson
Direction:
Approved
Assignee:
Akihiro Motoki
Definition:
Approved
Series goal:
Accepted for 14.0.0-rocky
Implementation:
Implemented
Milestone target:
milestone icon rocky-2
Started by
David Lyle
Completed by
Akihiro Motoki

Related branches

Sprints

Whiteboard

[Sep 11, 2018 -- amotoki] I completed all items I mentioned below at Dec 9, 2017. I believe this can be marked as implemented.

--

We have used https://etherpad.openstack.org/p/horizon-quotas-redo for a lot of notes

Gerrit topic: https://review.openstack.org/#q,topic:bp/make-quotas-great-again,n,z

Addressed by: https://review.openstack.org/356605 - Abandoned
    WIP Quota approach

Addressed by: https://review.openstack.org/362446 - Merged
    remove unused quotas code

Addressed by: https://review.openstack.org/357252 - Abandoned
    Splice QuotaUsage and QuotaSet classes

Addressed by: https://review.openstack.org/372549 - Merged
    Quota cleanup of dynamic methods

[Dec 9, 2017 -- amotoki]
I would like to take over this blueprint to achieve the following goals:
* Use neutron quota detail API to retrieve neutron resource usages (instead of list operations)
* Use neutron default quota API to fetch default quotas
* Push away nova-network related quotas (security_group and floating IP) and use neutron quota names consistently (at now nova-network and neutron quota names are used mixedly and it decreases the code readability a lot)
* Merge usages.quotas.tenant_limit_usages and tenant_quota_usages. They are two similar and the difference is what backend APIs are used (limits vs quotas).
* Some refactoring on usages/quotas.py

Addressed by: https://review.openstack.org/526697
    quota: Disable nova-network quotas completely

Addressed by: https://review.openstack.org/526698
    quota: retrive quota (limit) and usage at once

Addressed by: https://review.openstack.org/526699
    Use neutron quota_details API to retrieve usage

Addressed by: https://review.openstack.org/526700
    Use network quota field names consistently

Addressed by: https://review.openstack.org/526701
    Move neutron quota logic in identity.projects.views

Addressed by: https://review.openstack.org/526702
    Use neutron default quota (read-only) API

Addressed by: https://review.openstack.org/526703
    Merge tenant_limit_usage into tenant_quota_usage

Addressed by: https://review.openstack.org/526855
    quota: Move targets argument to get_disabled_quotas

Addressed by: https://review.openstack.org/526856
    usage: split out the limit related logic into ProjectUsageView

Addressed by: https://review.openstack.org/526857
    usage: Use tenant_quota_usages() for Limit Summary

Addressed by: https://review.openstack.org/526858
    usage: move field-specific logic from template to code

Addressed by: https://review.openstack.org/526859
    usage: Add network resources to Limit Summary

Addressed by: https://review.openstack.org/526860
    usage: Categorize Limit Summary by service

Gerrit topic: https://review.openstack.org/#q,topic:bug/1741493,n,z

Addressed by: https://review.openstack.org/531469
    Handle float('inf') in tenant_quota_usages properly

(?)

Work Items

Work items:
The reading of quotas, much of it centralized in the existing usage python module. : INPROGRESS
The writing/setting of quotas, which is more in the project edit screen. This code is likely a second pass.: TODO
The project modification screen might need to be split into separate screens / tools for quota management and for role membership. This is TBD, but the thinking is that the current project edit screen is more complex than we would like. Splitting into separate tools also makes it so the quota tool can see more changes / work with less fear for the impact on the role membership tool. : TODO

This blueprint contains Public information 
Everyone can see this information.