← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1545041] [NEW] Error 500 on resize when hitting quota

 

Public bug reported:

There's always KeyError exception when processing OverQuota in resize:

      File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 2697, in resize
        headroom = self._get_headroom(quotas, usages, deltas)
      File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 384, in _get_headroom
        hr = headroom['instances'] * deltas['ram']
    KeyError: 'instances'

This is because "quotas" parameter in OverQuota argument only contains
"cores" and "ram" resources (quota difference for resize operation), but
_get_headroom method expects "instances" resource to be present.

test_resize_quota_exceeds_fails does not handle this situation, because
"quotas" used in this test is "{'resource': 0}" and does not trigger
this branch of code in _get_headroom.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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/1545041

Title:
  Error 500 on resize when hitting quota

Status in OpenStack Compute (nova):
  New

Bug description:
  There's always KeyError exception when processing OverQuota in resize:

        File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 2697, in resize
          headroom = self._get_headroom(quotas, usages, deltas)
        File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 384, in _get_headroom
          hr = headroom['instances'] * deltas['ram']
      KeyError: 'instances'

  This is because "quotas" parameter in OverQuota argument only contains
  "cores" and "ram" resources (quota difference for resize operation),
  but _get_headroom method expects "instances" resource to be present.

  test_resize_quota_exceeds_fails does not handle this situation,
  because "quotas" used in this test is "{'resource': 0}" and does not
  trigger this branch of code in _get_headroom.

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


Follow ups