From fd26589afa2852762575feaae95a0c9b0c091461 Mon Sep 17 00:00:00 2001 From: Hans Lindgren Date: Thu, 11 Apr 2013 16:05:23 +0200 Subject: Make sure confirm_resize finishes before setting vm_state to ACTIVE Setting it to ACTIVE to early will allow new resize or whatever operations to start before the current confirm has finished which might result in all sorts of conflicts. Resolves bug 1161529 where an intermittent failure in a tempest test happens because a confirm operation conflicts with a later resize carried out on the same instance. As the new resize starts to move around instance disks, the still not finished confirm operation might fail at recalculating total disk usage due to a missing disk. Other possible conflicts might be due to system_metadata and/or quota not being up-to-date at the moment the instance becomes ACTIVE. Change-Id: I079da4e271469739504fa87e23149d03652d98f0 --- nova/compute/api.py | 4 ---- nova/compute/manager.py | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 493a6c882..6539719ef 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1863,10 +1863,6 @@ class API(base.Base): deltas = self._downsize_quota_delta(context, instance) reservations = self._reserve_quota_delta(context, deltas) - instance = self.update(context, instance, vm_state=vm_states.ACTIVE, - task_state=None, - expected_task_state=None) - self.db.migration_update(elevated, migration_ref['id'], {'status': 'confirming'}) # With cells, the best we can do right now is commit the reservations diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 19c8ee1a2..f020071df 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2081,6 +2081,11 @@ class ComputeManager(manager.SchedulerDependentManager): rt = self._get_resource_tracker(migration['source_node']) rt.confirm_resize(context, migration) + instance = self._instance_update(context, instance['uuid'], + vm_state=vm_states.ACTIVE, + task_state=None, + expected_task_state=None) + self._notify_about_instance_usage( context, instance, "resize.confirm.end", network_info=network_info) -- cgit