this problem can be reprodeced as bellow:
1. vm A in computeA, vm B in computeB, l2 pop enable;
2. vmB continue ping vmA
3. live migrate vmA to computeB
4. when live-migrate finish, vmB ping vmA failed
the reason is bellow, in l2pop driver, when vmA migrate to computeB, port status change form BUILD to ACTIVE,
it add the port to self.migrated_ports when port status is ACTIVE, but 'remove_fdb_entries' in port status is BUILD :
def update_port_postcommit(self, context):
...
...
elif (context.host != context.original_host
and context.status == const.PORT_STATUS_ACTIVE
and not self.migrated_ports.get(orig['id'])):
# The port has been migrated. We have to store the original
# binding to send appropriate fdb once the port will be set
# on the destination host
self.migrated_ports[orig['id']] = (
(orig, context.original_host))
elif context.status != context.original_status:
if context.status == const.PORT_STATUS_ACTIVE:
self._update_port_up(context)
elif context.status == const.PORT_STATUS_DOWN:
fdb_entries = self._update_port_down(
context, port, context.host)
self.L2populationAgentNotify.remove_fdb_entries(
self.rpc_ctx, fdb_entries)
elif context.status == const.PORT_STATUS_BUILD:
orig = self.migrated_ports.pop(port['id'], None)
if orig:
original_port = orig[0]
original_host = orig[1]
# this port has been migrated: remove its entries from fdb
fdb_entries = self._update_port_down(
context, original_port, original_host)
self.L2populationAgentNotify.remove_fdb_entries(
self.rpc_ctx, fdb_entries)
Fix proposed to branch: master /review. openstack. org/168802
Review: https:/