From 057138540df2b067bd3cd2857cceb97d1ecd86d0 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 2 Nov 2011 10:58:45 -0700 Subject: APIs should not wait on scheduler for builds in single zone deployment Fixes bug 885349 We can short circuit waiting on the scheduler if we're in a single zone deployment and only building 1 instance. This patch checks for that case and creates the instance DB entry directly in the API (in compute/api) without the call to the scheduler. Change-Id: I98b27156167f057d11fbc56a9ff99d4e2ec423d3 --- nova/api/ec2/cloud.py | 5 +---- nova/api/openstack/servers.py | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 16ea74025..b2aa120e6 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1437,10 +1437,7 @@ class CloudController(object): security_group=kwargs.get('security_group'), availability_zone=kwargs.get('placement', {}).get( 'AvailabilityZone'), - block_device_mapping=kwargs.get('block_device_mapping', {}), - # NOTE(comstud): Unfortunately, EC2 requires that the - # instance DB entries have been created.. - wait_for_instances=True) + block_device_mapping=kwargs.get('block_device_mapping', {})) return self._format_run_instances(context, resv_id) def _do_instance(self, action, context, ec2_id): diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 8c1eaae9d..b71e5df31 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -462,8 +462,7 @@ class Controller(object): user_data=user_data, availability_zone=availability_zone, config_drive=config_drive, - block_device_mapping=block_device_mapping, - wait_for_instances=not ret_resv_id) + block_device_mapping=block_device_mapping) except quota.QuotaError as error: self._handle_quota_error(error) except exception.InstanceTypeMemoryTooSmall as error: -- cgit