EC2 RunInstances fails with formatting error when multiple instances cannot be scheduled

Bug #1035726 reported by Eoghan Glynn
6
This bug affects 1 person
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/nova/nova/api/ec2/__init__.py", line 474, in __call__
2012-08-10 16:17:46 TRACE nova.api.ec2 result = api_request.invoke(context)
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/nova/nova/api/ec2/apirequest.py", line 81, in invoke
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/nova/nova/api/ec2/cloud.py", line 1200, in run_instances
2012-08-10 16:17:46 TRACE nova.api.ec2 return self._format_run_instances(context, resv_id)
2012-08-10 16:17:46 TRACE nova.api.ec2 File "/opt/stack/nova/nova/api/ec2/cloud.py", line 910, in _format_run_instances
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 RunInstancesResponse.

Eoghan Glynn (eglynn)
Changed in nova:
assignee: nobody → Eoghan Glynn (eglynn)
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Fixed as a side effect of:

  https://review.openstack.org/11379

Changed in nova:
milestone: none → folsom-3
status: New → Fix Committed
Eoghan Glynn (eglynn)
Changed in nova:
milestone: folsom-3 → none
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.