From 3ffc109e380e4a7b0d899f3881ced845abd5d58c Mon Sep 17 00:00:00 2001 From: Matt Dietz Date: Mon, 30 Jul 2012 18:17:40 +0000 Subject: Resize.end now includes the correct instance_type Fixes bug 1031004. Moves the notification to the destination compute node so that the correct instance_type attributes are assigned. Change-Id: I5886154ddd7a9768dc5d82dc4e43e9e0f681ee04 --- nova/compute/manager.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 686409e47..1bcc23a13 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1572,9 +1572,6 @@ class ComputeManager(manager.SchedulerDependentManager): self.compute_rpcapi.finish_resize(context, instance_ref, migration_id, image, disk_info, migration_ref['dest_compute']) - self._notify_about_instance_usage(context, instance_ref, "resize.end", - network_info=network_info) - def _finish_resize(self, context, instance, migration_ref, disk_info, image): resize_instance = False @@ -1650,6 +1647,17 @@ class ComputeManager(manager.SchedulerDependentManager): instance=instance) self._set_instance_error_state(context, instance['uuid']) + try: + network_info = self._get_instance_nw_info(context, instance) + except Exception, error: + with excutils.save_and_reraise_exception(): + msg = _('%s. Setting instance vm_state to ERROR') + LOG.error(msg % error) + self._set_instance_error_state(context, instance_uuid) + + self._notify_about_instance_usage(context, instance, "resize.end", + network_info=network_info) + @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @checks_instance_lock @wrap_instance_fault -- cgit