diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-11-02 10:58:45 -0700 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-11-02 11:55:29 -0700 |
| commit | 057138540df2b067bd3cd2857cceb97d1ecd86d0 (patch) | |
| tree | 55ff978831ae2c568b5d787be15718a0870dfc92 /nova/api | |
| parent | 830760b4c79cf9cdc80c6e0047ea206abc21f2c6 (diff) | |
| download | nova-057138540df2b067bd3cd2857cceb97d1ecd86d0.tar.gz nova-057138540df2b067bd3cd2857cceb97d1ecd86d0.tar.xz nova-057138540df2b067bd3cd2857cceb97d1ecd86d0.zip | |
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
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 5 | ||||
| -rw-r--r-- | nova/api/openstack/servers.py | 3 |
2 files changed, 2 insertions, 6 deletions
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: |
