Count resources to check quota in API for cells

Registered by melanie witt on 2016-10-19

For cellsv2, quota tables are moving to the API database as data global to
a deployment. Currently, for instance delete, quota reservations are made in
the API and then committed in compute. This is a disconnect which couples
compute cells with the API cell. In cellsv2, we endeavor to decouple compute
cells from the API cell as much as possible -- ideally, cells should not
need to have the API database connection in their configuration.

We propose a new approach of counting consumed resources and checking the
count against the quota limits in the API instead of the current reserve/commit
model where a reservation record is created, quota usage records are created
and marked as "in_use" when they are committed, and the reservarion record

Blueprint information

Matt Riedemann
melanie witt
melanie witt
Series goal:
Accepted for pike
Milestone target:
milestone icon pike-3
Started by
Matt Riedemann on 2017-01-04
Completed by
Matt Riedemann on 2017-07-24

Related branches



Gerrit topic:,topic:bp/cells-move-quota-commits-to-api,n,z

Addressed by:
    Proposal for moving quota commits to API for cells

Gerrit topic:,topic:bp/cells-count-resources-to-check-quota-in-api,n,z

Addressed by:
    Amend proposal to count resources to check quota in API for cells

Gerrit topic:,topic:cells-quota,n,z

Addressed by:
    WIP Count resources to check quota for cells

Addressed by:
    Make Quotas object favor the API database

Addressed by:
    Add online migration to move quotas to API database

I've deferred this to Pike. Let's re-propose the spec for Pike and then continue the work there. -- mriedem 20170203

Addressed by:
    Proposal to count resources to check quota in API for cells

Addressed by:
    Add Quotas.check_deltas() and set the stage for magic to happen

Addressed by:
    Count server group quotas

Addressed by:
    Count tenant_networks quotas

Addressed by:
    Count used_limits quotas

Addressed by:
    Remove useless quota_usage_refresh from nova-manage

Addressed by:
    Add get_count_by_vm_state() to Instance object

Addressed by:
    Add SecurityGroup.get_counts()

Addressed by:
    Add FixedIP.get_count_by_project()

Addressed by:
    Add FloatingIP.get_count_by_project()

Addressed by:
    Add InstanceGroup.get_counts()

Addressed by:
    Add InstanceGroup._remove_members_in_db

Addressed by:
    Count server group members to check quota

Addressed by:
    Count security groups to check quota

Addressed by:
    Count fixed ips for checking quota

Addressed by:
    Count floating ips to check quota

Addressed by:
    Clarify 'cells-count-resources-to-check-quota-in-api'

Addressed by:
    Default to 0 when merging values in limit check

Addressed by:
    Add scatter_gather_all_cells() utility

Addressed by:
    Make key_pairs use check_deltas for quota

Addressed by:
    Make security_group_rules use check_deltas for quota

Addressed by:
    Limit maximum pending resizes for preventing over quota

Gerrit topic:,topic:bug/1681989,n,z

Addressed by:
    Stop counting hw_video:ram_max_mb against quota

Addressed by:
    Default reservations=None in Cells v1 and conductor APIs


Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.