EC2 RunInstances fails with formatting error when multiple instances cannot be scheduled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Eoghan Glynn |
Bug Description
When multiple instances are requested via the EC2 RunInstances API (i.e. min_count>=2), but the scheduler cannot find a valid host, then the API call fails ungracefully with a formatting error, such as:
Unexpected error raised:
2012-08-10 16:17:46 TRACE nova.api.ec2 Traceback (most recent call last):
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/
2012-08-10 16:17:46 TRACE nova.api.ec2 result = api_request.
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/
2012-08-10 16:17:46 TRACE nova.api.ec2 result = method(context, **args)
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/
2012-08-10 16:17:46 TRACE nova.api.ec2 return self._format_
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/
2012-08-10 16:17:46 TRACE nova.api.ec2 assert len(i) == 1
2012-08-10 16:17:46 TRACE nova.api.ec2 AssertionError
This occurs because the run_instances RPC message is sent as a twoway call when multiple instances are launched, but the NoValidHost exception is caught and consumed within the scheduler, so that None is returned as the RPC result which the API layer then attempts to format as instances for the RunInstancesRes
Changed in nova: | |
assignee: | nobody → Eoghan Glynn (eglynn) |
Changed in nova: | |
milestone: | folsom-3 → none |
Changed in nova: | |
milestone: | none → folsom-rc1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | folsom-rc1 → 2012.2 |
Fixed as a side effect of:
https:/ /review. openstack. org/11379