Skip to content

Commit

Permalink
Set instance['host'] to the original host value on revert resize.
Browse files Browse the repository at this point in the history
Fixes bug #901445

Change-Id: I8c112d92d6a54715073ef1119372d782c3be37c9
  • Loading branch information
Dan Prince authored and markmc committed Jan 4, 2012
1 parent b4cfd9a commit 50f82d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions nova/compute/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ def finish_revert_resize(self, context, instance_id, migration_id):
self._instance_update(context,
instance_ref["uuid"],
memory_mb=instance_type['memory_mb'],
host=migration_ref['source_compute'],
vcpus=instance_type['vcpus'],
local_gb=instance_type['local_gb'],
instance_type_id=instance_type['id'])
Expand Down
1 change: 1 addition & 0 deletions nova/tests/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ def fake(*args, **kwargs):
instance_type_ref = db.instance_type_get(context,
inst_ref['instance_type_id'])
self.assertEqual(instance_type_ref['flavorid'], 1)
self.assertEqual(inst_ref['host'], migration_ref['source_compute'])

self.compute.terminate_instance(context, instance_id)

Expand Down

0 comments on commit 50f82d1

Please sign in to comment.