PUT /allocations/{consumer_id} fails with a 500 if "resources: {}"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Chris Dent | ||
Pike |
Fix Committed
|
Medium
|
Matt Riedemann |
Bug Description
I hit this while writing a functional recreate test for bug 1713786 where the destination node during an evacuate doesn't have it's allocations created by the scheduler. When the source node comes up after the evacuation, it tries to remove the allocations on the source node, which is the only one because of bug 1713786, but that results in sending a request like this:
2017-08-30 14:45:13,495 INFO [nova.scheduler
And you get this stacktrace in the Placement API:
2017-08-30 14:45:13,502 ERROR [nova.api.
Traceback (most recent call last):
File "nova/api/
return dispatch(environ, start_response, self._map)
File "nova/api/
return handler(environ, start_response)
File "/home/
resp = self.call_func(req, *args, **self.kwargs)
File "nova/api/
File "/home/
return self.func(req, *args, **kwargs)
File "nova/api/
return _find_method(f, version)(req, *args, **kwargs)
File "nova/api/
return f(req)
File "nova/api/
return _set_allocation
File "nova/api/
File "nova/objects/
File "/home/
ectxt.value = e.inner_exc
File "/home/
File "/home/
File "/home/
return f(*args, **kwargs)
File "/home/
return fn(*args, **kwargs)
File "nova/objects/
consumer_id = allocs[
IndexError: list index out of range
The schema validation on PUT /allocations requires a minimum of one provider in the request, but it doesn't validate that there is at least one resource for that provider:
Changed in nova: | |
assignee: | nobody → Chris Dent (cdent) |
Changed in nova: | |
assignee: | Chris Dent (cdent) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → Chris Dent (cdent) |
what should the outcome be here:
* 400 you didn't follow the schema
* 204 we erased allocations for that resource provider