Enforce quota usage from placement when unshelving
When [quota]count_usage_from_placement = true or
[quota]driver = nova.quota.UnifiedLimitsDriver, cores and ram quota
usage are counted from placement. When an instance is SHELVED_OFFLOADED,
it will not have allocations in placement, so its cores and ram should
not count against quota during that time.
This means however that when an instance is unshelved, there is a
possibility of going over quota if the cores and ram it needs were
allocated by some other instance(s) while it was SHELVED_OFFLOADED.
This fixes a bug where quota was not being properly enforced during
unshelve of a SHELVED_OFFLOADED instance when quota usage is counted
from placement. Test coverage is also added for the "recheck" quota
cases.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /872471 /opendev. org/openstack/ nova/commit/ 6f79d6321e7c3ed aab2eb911198b7b 7f851371b3
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 6f79d6321e7c3ed aab2eb911198b7b 7f851371b3
Author: melanie witt <email address hidden>
Date: Fri Jan 27 03:08:09 2023 +0000
Enforce quota usage from placement when unshelving
When [quota] count_usage_ from_placement = true or UnifiedLimitsDr iver, cores and ram quota
[quota]driver = nova.quota.
usage are counted from placement. When an instance is SHELVED_OFFLOADED,
it will not have allocations in placement, so its cores and ram should
not count against quota during that time.
This means however that when an instance is unshelved, there is a
possibility of going over quota if the cores and ram it needs were
allocated by some other instance(s) while it was SHELVED_OFFLOADED.
This fixes a bug where quota was not being properly enforced during
unshelve of a SHELVED_OFFLOADED instance when quota usage is counted
from placement. Test coverage is also added for the "recheck" quota
cases.
Closes-Bug: #2003991
Change-Id: I4ab97626c10052 c7af9934a80ff8d b9ddab82738