From 6682d1617e7085c8f956ff6b23ea6932ec986a3e Mon Sep 17 00:00:00 2001 From: Sam Morrison Date: Tue, 7 May 2013 12:07:53 +1000 Subject: [PATCH] Adds live migration support to cells API Fixes bug 1153087 DocImpact: Cells now allows live migration within a cell, but not between cells. Change-Id: Ic8777c376883eaf6ff9cb4b379e0bacbfe5635b7 --- nova/compute/cells_api.py | 10 ++++++++++ nova/tests/compute/test_compute_cells.py | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nova/compute/cells_api.py b/nova/compute/cells_api.py index 7168313ec402..4beeaeb3dfc5 100644 --- a/nova/compute/cells_api.py +++ b/nova/compute/cells_api.py @@ -559,6 +559,16 @@ class ComputeCellsAPI(compute_api.API): pass return rv + @validate_cell + def live_migrate(self, context, instance, block_migration, + disk_over_commit, host_name): + """Migrate a server lively to a new host.""" + super(ComputeCellsAPI, self).live_migrate(context, + instance, block_migration, disk_over_commit, host_name) + + self._cast_to_cells(context, instance, 'live_migrate', + block_migration, disk_over_commit, host_name) + class HostAPI(compute_api.HostAPI): """HostAPI() class for cells. diff --git a/nova/tests/compute/test_compute_cells.py b/nova/tests/compute/test_compute_cells.py index 40ae4e3de60a..ad4e6c754b9d 100644 --- a/nova/tests/compute/test_compute_cells.py +++ b/nova/tests/compute/test_compute_cells.py @@ -145,9 +145,6 @@ class CellsComputeAPITestCase(test_compute.ComputeAPITestCase): def test_instance_metadata(self): self.skipTest("Test is incompatible with cells.") - def test_live_migrate(self): - self.skipTest("Test is incompatible with cells.") - def test_snapshot_given_image_uuid(self): self.skipTest("Test doesn't apply to API cell.")