diff --git a/nova/network/api.py b/nova/network/api.py index e4fd38b133e2..4b803482a987 100644 --- a/nova/network/api.py +++ b/nova/network/api.py @@ -351,7 +351,7 @@ class API(base.Base): if self._is_multi_host(context, instance): args['floating_addresses'] = \ self._get_floating_ip_addresses(context, instance) - args['host'] = migration['dest_compute'] + args['host'] = migration['source_compute'] self.network_rpcapi.migrate_instance_start(context, **args) diff --git a/nova/tests/network/test_api.py b/nova/tests/network/test_api.py index bfc9dc878fc1..15ead5337dc9 100644 --- a/nova/tests/network/test_api.py +++ b/nova/tests/network/test_api.py @@ -117,7 +117,6 @@ class ApiTestCase(test.TestCase): 'project_id': 'fake_project_id', 'floating_addresses': None} if multi_host: - expected['host'] = 'fake_compute_dest' expected['floating_addresses'] = ['fake_float1', 'fake_float2'] return fake_instance, fake_migration, expected @@ -125,6 +124,7 @@ class ApiTestCase(test.TestCase): info = {'kwargs': {}} arg1, arg2, expected = self._stub_migrate_instance_calls( 'migrate_instance_start', True, info) + expected['host'] = 'fake_compute_source' self.network_api.migrate_instance_start(self.context, arg1, arg2) self.assertEqual(info['kwargs'], expected) @@ -139,6 +139,7 @@ class ApiTestCase(test.TestCase): info = {'kwargs': {}} arg1, arg2, expected = self._stub_migrate_instance_calls( 'migrate_instance_finish', True, info) + expected['host'] = 'fake_compute_dest' self.network_api.migrate_instance_finish(self.context, arg1, arg2) self.assertEqual(info['kwargs'], expected)