Quota calculation connects to all available cells
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| OpenStack Compute (nova) |
Medium
|
Surya Seetharaman | ||
| Rocky |
Medium
|
Unassigned |
Bug Description
Quota utilisation calculation connects to all cells DBs to get all consumed resources for a project.
When having several cells this can be inefficient and can fail if one of the cell DBs is not available.
To calculate the quota utilization of a project should be enough to use only the cells where the project has/had instances. This information is available in nova_api DB.
Changed in nova: | |
assignee: | nobody → Surya Seetharaman (tssurya) |
Matt Riedemann (mriedem) wrote : | #1 |
melanie witt (melwitt) wrote : | #2 |
Agreed that this enhancement will be either part of handling a down cell or moving to count quota usage from placement.
On the latter, we're currently blocked from moving to counting usage from placement because placement has no way to differentiate resource ownership among many potential services. So, calling the placement /usages API will return resource usage for all services that have added allocations to placement, not only a particular instance of nova.
Like Matt said, the best we could do at present is leverage the instance_mappings table to filter which cells we count for quota usage, like we do for instance list.
Looking at the nova/quota.py code, I see that we should also do the same for server group members. We have to count them by user and we don't have 'user_id' in the instance_mappings table, but we could at least filter on the project_id for choosing which cells to query.
Changed in nova: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Matt Riedemann (mriedem) wrote : | #3 |
Looks like Surya has started something for this here:
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
importance: | Low → Medium |
Changed in nova: | |
assignee: | Surya Seetharaman (tssurya) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Surya Seetharaman (tssurya) |
Changed in nova: | |
assignee: | Surya Seetharaman (tssurya) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Surya Seetharaman (tssurya) |
Reviewed: https:/
Committed: https:/
Submitter: Zuul
Branch: master
commit 77881659251bdff
Author: Surya Seetharaman <email address hidden>
Date: Thu May 17 10:16:56 2018 +0200
Make _instances_
This makes the _instances_
in cells that the tenant actually has instances landed in. We do this by
getting a list of cell mappings that have instance mappings owned by the
project and limiting the scatter/gather operation to just those cells.
Change-Id: I0e2a9b2460145d
Closes-Bug: #1771810
Changed in nova: | |
status: | In Progress → Fix Released |
This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.
This seems like either something that should be a part of https:/ /blueprints. launchpad. net/nova/ +spec/handling- down-cell or https:/ /blueprints. launchpad. net/nova/ +spec/count- quota-usage- from-placement.
Even if we pre-determined which cells the project has instances in, if any of those cells are down then we're still not getting an accurate usage count if we're using the cell database. To pre-determine which cells a project has instances in, I think we could do that via the instance_mappings records in the nova_api database, maybe similar to how listing instances was modified with this change:
https:/ /review. openstack. org/#/c/ 509003/
The instance_mappings table doesn't have a user_id column so any quota we would need to count that involves a user_id would not work here though. This bug isn't specific about which quota is being calculated and when (server create or just when hitting the limits API?).