diff options
Diffstat (limited to 'nova/compute/manager.py')
-rw-r--r-- | nova/compute/manager.py | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index f6f5f4a936..c5e98fd67e 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -4672,10 +4672,7 @@ class ComputeManager(manager.Manager): self._delete_volume_attachments(ctxt, bdms) # Free up the new_flavor usage from the resource tracker for this host. - instance.revert_migration_context() - instance.save(expected_task_state=task_states.RESIZE_REVERTING) - self.rt.drop_move_claim(ctxt, instance, instance.node, - instance_type=instance.new_flavor) + self.rt.drop_move_claim_at_dest(ctxt, instance, migration) def _revert_instance_flavor_host_node(self, instance, migration): """Revert host, node and flavor fields after a resize-revert.""" @@ -4873,20 +4870,9 @@ class ComputeManager(manager.Manager): self._terminate_volume_connections(context, instance, bdms) - migration.status = 'reverted' - migration.save() - - # NOTE(ndipanov): We need to do this here because dropping the - # claim means we lose the migration_context data. We really should - # fix this by moving the drop_move_claim call to the - # finish_revert_resize method as this is racy (revert is dropped, - # but instance resources will be tracked with the new flavor until - # it gets rolled back in finish_revert_resize, which is - # potentially wrong for a period of time). - instance.revert_migration_context() - instance.save() - - self.rt.drop_move_claim(context, instance, instance.node) + # Free up the new_flavor usage from the resource tracker for this + # host. + self.rt.drop_move_claim_at_dest(context, instance, migration) # RPC cast back to the source host to finish the revert there. self.compute_rpcapi.finish_revert_resize(context, instance, |