← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2003991] Re: Quota not properly enforced during unshelve when [quota]count_usage_from_placement = True

 

Reviewed:  https://review.opendev.org/c/openstack/nova/+/872471
Committed: https://opendev.org/openstack/nova/commit/6f79d6321e7c3edaab2eb911198b7b7f851371b3
Submitter: "Zuul (22348)"
Branch:    master

commit 6f79d6321e7c3edaab2eb911198b7b7f851371b3
Author: melanie witt <melwittt@xxxxxxxxx>
Date:   Fri Jan 27 03:08:09 2023 +0000

    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.
    
    Closes-Bug: #2003991
    
    Change-Id: I4ab97626c10052c7af9934a80ff8db9ddab82738


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2003991

Title:
  Quota not properly enforced during unshelve when
  [quota]count_usage_from_placement = True

Status in OpenStack Compute (nova):
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2003991/+subscriptions



References