Bug 2166486 - Quota not properly enforced during unshelve when [quota]count_usage_from_placement = True
Summary: Quota not properly enforced during unshelve when [quota]count_usage_from_plac...
Keywords:
Status: ON_DEV
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: async
: 16.2 (Train on RHEL 8.4)
Assignee: melanie witt
QA Contact: OSP DFG:Compute
URL:
Whiteboard:
Depends On: 2222824
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-01 23:49 UTC by melanie witt
Modified: 2023-07-20 15:36 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2222824 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 2003991 0 None None None 2023-02-01 23:49:17 UTC
OpenStack gerrit 872470 0 None NEW Reproducer for bug 2003991 unshelving offloaded instance 2023-05-22 15:43:15 UTC
OpenStack gerrit 872471 0 None NEW Enforce quota usage from placement when unshelving 2023-05-22 15:43:18 UTC
Red Hat Issue Tracker OSP-21991 0 None None None 2023-02-01 23:52:13 UTC

Description melanie witt 2023-02-01 23:49:17 UTC
Copied from upstream bug [2]:

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://docs.openstack.org/nova/latest/admin/quotas.html#quota-usage-from-placement

[2] https://bugs.launchpad.net/nova/+bug/2003991


Note You need to log in before you can comment on or make changes to this bug.