From 5fb947208e7141e572d7e2e95165c715f23b5fda Mon Sep 17 00:00:00 2001 From: Ante Karamatic Date: Sat, 20 Apr 2013 10:50:14 +0200 Subject: Destroy conntrack table on source host during migration If a VM migrates from hostA to hostB, there will still be connections in the conntrack table of the hostA. If, for any reason, VM is migrated back to the hostA, while those connections are still in conntrack table, persistent connections (such is ssh) to VM, from outside, will get dropped. They get dropped cause hostA was expecting different packets and cause of that requires establishing new connection. By dropping conntrack table entries for VM we make sure that connection flow is not interupted by old packets. Change-Id: If8e146e05914e9febd6fc40a1d8085306c1244ea --- nova/tests/network/test_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py index f0d8e58a9..7fa347ceb 100644 --- a/nova/tests/network/test_manager.py +++ b/nova/tests/network/test_manager.py @@ -2161,6 +2161,10 @@ class FloatingIPTestCase(test.TestCase): network): called['count'] += 1 + def fake_clean_conntrack(fixed_ip): + if not fixed_ip == "10.0.0.2": + raise exception.FixedIpInvalid(address=fixed_ip) + def fake_floating_ip_update(context, address, args): pass @@ -2173,6 +2177,8 @@ class FloatingIPTestCase(test.TestCase): fake_floating_ip_update) self.stubs.Set(self.network.l3driver, 'remove_floating_ip', fake_remove_floating_ip) + self.stubs.Set(self.network.l3driver, 'clean_conntrack', + fake_clean_conntrack) self.mox.ReplayAll() addresses = ['172.24.4.23', '172.24.4.24', '172.24.4.25'] self.network.migrate_instance_start(self.context, -- cgit