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
This commit is contained in:
Trey Morris
2012-02-27 19:07:31 -06:00
parent caff14bb65
commit 19c7ea5608
2 changed files with 9 additions and 1 deletions

View File

@@ -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}})

View File

@@ -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)