← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1705071] [NEW] [placement] Attempting to find allocation candidates for shared-only resources results in KeyError

 

Public bug reported:

When attempting to perform a GET /allocation_candidates request for only
resources that are shared, a KeyError is produced:

http://paste.openstack.org/show/615753/

The problem is that the _get_usages_by_provider_and_rc() method returns
a dict with only the sharing resource provider usage information but the
_get_all_with_shared() returns a list of resource provider IDs including
both the *sharing* resource provider *and* the shared-with providers.

When the code attempts to cross-reference provider summaries (which are
constructed by looping over the usage dicts) with each provider ID in
the result from _get_all_with_shared(), we hit a KeyError on the shared-
with provider IDs because there was no usage record (because the usage
query filters on resource class ID and we requested only a resource
class ID that was shared)

** Affects: nova
     Importance: High
         Status: Triaged


** Tags: placement

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

Title:
  [placement] Attempting to find allocation candidates for shared-only
  resources results in KeyError

Status in OpenStack Compute (nova):
  Triaged

Bug description:
  When attempting to perform a GET /allocation_candidates request for
  only resources that are shared, a KeyError is produced:

  http://paste.openstack.org/show/615753/

  The problem is that the _get_usages_by_provider_and_rc() method
  returns a dict with only the sharing resource provider usage
  information but the _get_all_with_shared() returns a list of resource
  provider IDs including both the *sharing* resource provider *and* the
  shared-with providers.

  When the code attempts to cross-reference provider summaries (which
  are constructed by looping over the usage dicts) with each provider ID
  in the result from _get_all_with_shared(), we hit a KeyError on the
  shared-with provider IDs because there was no usage record (because
  the usage query filters on resource class ID and we requested only a
  resource class ID that was shared)

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


Follow ups