Merge "XenAPI: Create linux bridge in dest host during live migration" into stable/ocata

This commit is contained in:
Jenkins 2017-08-11 18:24:12 +00:00 committed by Gerrit Code Review
commit 005d3cfa7f
2 changed files with 6 additions and 1 deletions

View File

@ -3420,7 +3420,8 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBaseNoDB):
self.assertTrue(result)
pre.assert_called_with("ctx", "inst", "bdi", "nw", "di", "data")
def test_post_live_migration_at_destination(self):
@mock.patch.object(vmops.VMOps, '_post_start_actions')
def test_post_live_migration_at_destination(self, mock_post_action):
# ensure method is present
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False)
@ -3464,6 +3465,7 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBaseNoDB):
self.assertEqual(fake_fw.call_count, 3)
self.assertTrue(fake_get_vm_opaque_ref.called)
self.assertTrue(fake_strip_base_mirror_from_vdis.called)
mock_post_action.assert_called_once_with(fake_instance)
def test_check_can_live_migrate_destination_with_block_migration(self):
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)

View File

@ -2476,6 +2476,9 @@ class VMOps(object):
# applied security groups, however this requires changes to XenServer
self._prepare_instance_filter(instance, network_info)
self.firewall_driver.apply_instance_filter(instance, network_info)
# hook linux bridge and ovs bridge at destination
self._post_start_actions(instance)
vm_utils.create_kernel_and_ramdisk(context, self._session, instance,
instance['name'])