XenAPI: Create linux bridge in dest host during live migration

We found VM can live migrate successfully with XenServer hypervisor,
but after migrating to dest host, we cannot ping the VM's floating
or fixed IP any more. The problem is, during live migration, we only
create the network in dest host which the VM's VIF connect to, but we
don't establish the linux bridge and the corresponding veth pair to
integration bridge br-int.

Closes-Bug: 1677937

Change-Id: I0d69d2ba5b064ef303445892791804608e7f19c5
This commit is contained in:
Huan Xie 2017-05-03 00:19:21 -07:00
parent 3a5d592e60
commit d89fe544bd
2 changed files with 6 additions and 1 deletions

View File

@ -3477,7 +3477,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)
@ -3521,6 +3522,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

@ -2470,6 +2470,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'])