From 19c7ea5608a012920e0276aec63a9190db4cbd4f Mon Sep 17 00:00:00 2001 From: Trey Morris Date: Mon, 27 Feb 2012 19:07:31 -0600 Subject: [PATCH] Setup and teardown networks during migration * fixes lp939060 * live migration and resize nova appropriately setup and teardown networking related to network hosts * deallocate_fixed_ip is now run on the correct host resulting in the network structures being torn down correctly Change-Id: I2c86989ab7c6593bf346611cde8c043116d55bc5 --- nova/tests/test_compute.py | 8 ++++++++ nova/tests/test_network.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 522f57eb..4c18793d 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -1388,6 +1388,10 @@ class ComputeTestCase(BaseTestCase): 'disk': None} }).AndRaise(rpc.common.RemoteError('', '', '')) # mocks for rollback + rpc.call(c, 'network', {'method': 'setup_networks_on_host', + 'args': {'instance_id': instance_id, + 'host': self.compute.host, + 'teardown': False}}) rpc.call(c, topic, {"method": "remove_volume_connection", "args": {'instance_id': instance_id, 'volume_id': volume_id}}) @@ -1456,6 +1460,10 @@ class ComputeTestCase(BaseTestCase): self.mox.StubOutWithMock(self.compute.driver, 'unfilter_instance') self.compute.driver.unfilter_instance(i_ref, []) self.mox.StubOutWithMock(rpc, 'call') + rpc.call(c, 'network', {'method': 'setup_networks_on_host', + 'args': {'instance_id': instance_id, + 'host': self.compute.host, + 'teardown': True}}) rpc.call(c, db.queue_get_for(c, FLAGS.compute_topic, dest), {"method": "post_live_migration_at_destination", "args": {'instance_id': i_ref['id'], 'block_migration': False}}) diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py index 2606ba0d..31b9ba21 100644 --- a/nova/tests/test_network.py +++ b/nova/tests/test_network.py @@ -838,7 +838,7 @@ class VlanNetworkTestCase(test.TestCase): # Clean up the ip addresses self.network.disassociate_floating_ip(context1, float_addr) self.network.deallocate_floating_ip(context1, float_addr) - self.network.deallocate_fixed_ip(context1, fix_addr) + self.network.deallocate_fixed_ip(context1, fix_addr, 'fake') db.floating_ip_destroy(context1.elevated(), float_addr) db.fixed_ip_disassociate(context1.elevated(), fix_addr)