Ensure that vif ports are unplugged during failover migration

There is a race condition during failover migration, that, when
triggered, stops the host from proper cleanup.
If the destination node finishes the failover before the host,
proper cleanup is done, otherwise there will pe an ovs port
remaining on the source host.

This change addresses this issue by removing the race condition
which was previously used to check if the migration was done
properly.
This doesn't completly fix the because, if the host was already updated,
no aciton is taken at the source node.

Change-Id: I50213de235907f80e1d4266dfd6785ea147a7f0c
Partial-Bug: #1705992
This commit is contained in:
Alexandru Muresan 2017-07-24 11:03:37 +03:00
parent 37b3a54aea
commit dc2daad2fc
2 changed files with 0 additions and 14 deletions

View File

@ -128,8 +128,6 @@ class ClusterOps(object):
# to treat it as a failover.
LOG.debug('Instance %s is live migrating.', instance_name)
return
if instance.host.upper() == self._this_node.upper():
return
nw_info = self._network_api.get_instance_nw_info(self._context,
instance)

View File

@ -165,18 +165,6 @@ class ClusterOpsTestCase(test_base.HyperVBaseTestCase):
mock_LOG.debug.assert_called_once_with(
'Instance %s is live migrating.', mock.sentinel.instance_name)
@mock.patch.object(clusterops.ClusterOps, '_get_instance_by_name')
def test_failover_migrate_same_host(self, mock_get_instance_by_name):
instance = mock_get_instance_by_name.return_value
instance.host = self.clusterops._this_node
self.clusterops._failover_migrate(mock.sentinel.instance_name,
mock.sentinel.old_host,
mock.sentinel.new_host)
self.assertFalse(
self.clusterops._network_api.get_instance_nw_info.called)
@mock.patch.object(clusterops.ClusterOps, '_get_instance_by_name')
def test_failover_migrate_at_source_node(self, mock_get_instance_by_name):
instance = mock_get_instance_by_name.return_value