From 2649f14673f8ef5ca257583f1cdf5fe57d4734b9 Mon Sep 17 00:00:00 2001 From: Brian Elliott Date: Tue, 16 Oct 2012 15:58:20 +0000 Subject: [PATCH] Set host prior to allocating network information. Make sure 'host' field on the instance is set before allocating network information. bug 1065004 Change-Id: I7b929fd50a057c8c69a0b83e07cdc5cd9cb55b45 --- nova/compute/manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 7cd54bd752a0..20aa07276001 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -482,13 +482,14 @@ class ComputeManager(manager.SchedulerDependentManager): self._notify_about_instance_usage( context, instance, "create.start", extra_usage_info=extra_usage_info) - network_info = self._allocate_network(context, instance, - requested_networks) + network_info = None try: limits = filter_properties.get('limits', {}) with self.resource_tracker.resource_claim(context, instance, limits): + network_info = self._allocate_network(context, instance, + requested_networks) block_device_info = self._prep_block_device(context, instance) instance = self._spawn(context, instance, image_meta, @@ -533,7 +534,7 @@ class ComputeManager(manager.SchedulerDependentManager): try: self._deallocate_network(context, instance) except Exception: - # do not attempt retry if network de-allocation occurs: + # do not attempt retry if network de-allocation failed: _log_original_error() raise