Not process security group for none active ports

We recently met an issue during VM live migration:
1. nova starts live migration
2. plug ports on new host
3. neutron-ovs-agent starts to process the port,
   but the port is in 'added' and 'updated' set
   at the same time.
4. because nova still not activate the destination
   port binding, so there is no local vlan for
   this port.
Then, ovs-agent met errors:
Error while processing VIF ports: OVSFWTagNotFound:
Cannot get tag for port tap092f38ed-a7 from its other_config: {}

This fix is to remove ports of the
"binding_no_activated_devices" for ``setup_port_filters``.

Closes-Bug: #2048979
Change-Id: I0f1e6bf202ef08f75246d6e99b3774d0b6fc9e2b
This commit is contained in:
LIU Yulong 2024-01-11 15:13:27 +08:00
parent 1348b92ae5
commit 70eb4006c6
2 changed files with 4 additions and 3 deletions

View File

@ -2272,8 +2272,9 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
binding_no_activated_devices - migrating_devices)
self.process_install_ports_egress_flows(need_binding_devices)
added_to_datapath = added_ports - devices_not_in_datapath
self.sg_agent.setup_port_filters(added_to_datapath,
port_info.get('updated', set()))
self.sg_agent.setup_port_filters(
added_to_datapath,
port_info.get('updated', set()) - binding_no_activated_devices)
LOG.info("process_network_ports - iteration:%(iter_num)d - "
"agent port security group processed in %(elapsed).3f",

View File

@ -1212,7 +1212,7 @@ class TestOvsNeutronAgent(object):
setup_port_filters.assert_called_once_with(
(added_devices - set(skipped_devices) -
binding_no_activated_devices),
port_info.get('updated', set()))
port_info.get('updated', set()) - binding_no_activated_devices)
devices_added_updated = (added_devices |
port_info.get('updated', set()))
if devices_added_updated: