Quota not properly enforced during unshelve when [quota]count_usage_from_placement = True
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
melanie witt | ||
Antelope |
Fix Released
|
Medium
|
Unassigned | ||
Train |
Won't Fix
|
Undecided
|
Unassigned | ||
Ussuri |
Won't Fix
|
Undecided
|
Unassigned | ||
Victoria |
New
|
Undecided
|
Unassigned | ||
Wallaby |
New
|
Undecided
|
Unassigned | ||
Xena |
New
|
Undecided
|
Unassigned | ||
Yoga |
In Progress
|
Undecided
|
Unassigned | ||
Zed |
In Progress
|
Undecided
|
Unassigned |
Bug Description
When nova is configured to count quota usage from placement [1], there are some behaviors that are different from the legacy quota resource counting.
With legacy quotas, all of an instance's resources remained consumed from a quota perspective while the instance was SHELVED_OFFLOADED. Because of this, there was no need to check quota when doing an unshelve and an unshelve request could not be blocked for quota related reasons. The quota usage remained the same whether the instance was SHELVED_OFFLOADED or not.
With counting quota usage from placement, cores and ram resource usage is counted from placement while instances are counted from the API database. And when an instance is SHELVED_OFFLOADED, it does not have any resource allocations in placement for cores and ram during that time. Because of this, it is possible to go over cores and ram quota after unshelving an instance as new resources will be allocated in placement for the unshelved instance.
The unshelve quota scenario is currently not being properly enforced because there are no quota checks in the scheduling code path, so when the unshelving instance goes through the scheduling process, it is not validated against quota. There needs to be a dedicated quota check for unshelve.
[1] https:/
Changed in nova: | |
status: | New → Confirmed |
status: | Confirmed → In Progress |
Related fix proposed to branch: master /review. opendev. org/c/openstack /nova/+ /872470
Review: https:/