From 0fe9beb7c0ae763c9d5bfd8598ec7e79b2fbf42c Mon Sep 17 00:00:00 2001 From: Guan Qiang Date: Tue, 26 Mar 2013 17:47:11 +0800 Subject: Fix migrating instance to the same host. In current code logic, Migration to the same host is allowed which is meaningless. In the patch, a Conf flag 'allow_migrate_to_same_host' is added and set to false as default. When 'allow_migrate_to_same_host' is false, the current instance host will be added into filter property 'ignore_hosts' to avoid migrating instance to the same host. Fixes: bug #1160268 Change-Id: I5ac0391cf468310a89fb6d8a8f5120c5654cb4ff --- nova/tests/compute/test_compute.py | 1 + 1 file changed, 1 insertion(+) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index c36496f79..5317ecf0b 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -5553,6 +5553,7 @@ class ComputeAPITestCase(BaseTestCase): self.stubs.Set(rpc, 'cast', _fake_cast) self.flags(allow_resize_to_same_host=True) + self.flags(allow_migrate_to_same_host=True) instance = self._create_fake_instance(dict(host='host2')) instance = db.instance_get_by_uuid(self.context, instance['uuid']) -- cgit