neutron-openvswitch-agent report error when batch delete instances

Bug #1729213 reported by yangjianfeng
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Zachary Ma

Bug Description

I created some instance with same network and same security group. The security group's remote secrity group is set to itself.
Then I batch delete these instances.when the first instance's port is deleted,it will notify other neutron-ovs-agent so that these agent could update filter rules for other instance's port.
But variable "defer_refresh_firewall" is set to true,so the update process will not be executed immediately.
During the subsequent instance deletion,the process will be triggered,But the port within subsequent instance is deleted,So the agent will report error.

2017-11-01 09:30:29.695 9779 ERROR neutron.agent.linux.openvswitch_firewall.firewall [req-610bc095-2445-4f2e-8a46-181a82087348 - - - - -] Initializing unfiltered port 2c8f784d-1e73-4e4d-874d-65dd32de4e22 that does not exist in ovsdb: Port 2c8f784d-1e73-4e4d-874d-65dd32de4e22 is not managed by this agent..: OVSFWPortNotFound: Port 2c8f784d-1e73-4e4d-874d-65dd32de4e22 is not managed by this agent.

summary: - neutron-ovs-agnet report error when batch delete instances
+ neutron-openvswitch-agnet report error when batch delete instances
Zachary Ma (mazengxie)
summary: - neutron-openvswitch-agnet report error when batch delete instances
+ neutron-openvswitch-agent report error when batch delete instances
Changed in neutron:
status: New → Confirmed
Revision history for this message
Zachary Ma (mazengxie) wrote :

in function as follow:
 def get_or_create_ofport(self, port):
        """Get ofport specified by port['device'], checking and reflecting
        ofport changes.
        If ofport is nonexistent, create and return one.
        """
        port_id = port['device']
        ovs_port = self.get_ovs_port(port_id)

libvirt will delete tap when removed vms .then, ovs agent check ovs_port by "self.get_ovs_port" , and the exception will be raised.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/518188

Changed in neutron:
assignee: nobody → Zachary Ma (mazengxie)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/518190

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Zachary Ma (mazengxie@126.com) on branch: master
Review: https://review.openstack.org/518188

Revision history for this message
Zachary Ma (mazengxie) wrote :
Download full text (5.4 KiB)

2017-11-01 09:33:10.844 157874 INFO neutron.agent.common.ovs_lib [req-d8c2d9bb-ea70-498c-9d28-92df6e7a84bd - - - - -] Port f0760ad8-8f1c-47b3-8347-3e7d282ccdf5 not present in bridge br-int
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent [req-d8c2d9bb-ea70-498c-9d28-92df6e7a84bd - - - - -] Error while processing VIF ports: OVSFWPortNotFound: Port f0760ad8-8f1c-47b3-8347-3e7d282ccdf5 is not managed by this agent.
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent Traceback (most recent call last):
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 2071, in rpc_loop
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent port_info, ovs_restarted)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 153, in wrapper
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent return f(*args, **kwargs)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 1674, in process_network_ports
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent port_info.get('updated', set()))
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/agent/securitygroups_rpc.py", line 277, in setup_port_filters
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent self.refresh_firewall(updated_devices)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/agent/securitygroups_rpc.py", line 110, in decorated_function
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent *args, **kwargs)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/agent/securitygroups_rpc.py", line 230, in refresh_firewall
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent self._apply_port_filter(device_ids, update_filter=True)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/agent/securitygroups_rpc.py", line 141, in _apply_port_filter
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent self.firewall.update_port_filter(device)
2017-11-01 09:33:10.845 157874 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent File "/usr/lib/python2.7/site-packages/neutron/ag...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/525890

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/518190
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=364e5db586a93902e99f68a8e213ad9b2a9f39b5
Submitter: Zuul
Branch: master

commit 364e5db586a93902e99f68a8e213ad9b2a9f39b5
Author: Zachary <mazengxie@126.com>
Date: Tue Nov 7 09:09:48 2017 +0800

    ovs-fw: catches exception from ovsdb

    OVS agent will raise an exception when deleting
    multiple vms in bulk. Nova will delete tap when vms are
    removed. Then, ovs agent checks ovs_port
    by calling "self.get_ovs_port", and the exception will be raised.
    The patch will catch exception.

    Change-Id: Ief7de22e5f85253d8a25ecfbb139a8f87c1a0b35
    Closes-Bug: #1729213

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.0.0b2

This issue was fixed in the openstack/neutron 12.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/525890
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=622d0bce38863a644c63cdd2f1a07aead9df4fc8
Submitter: Zuul
Branch: stable/pike

commit 622d0bce38863a644c63cdd2f1a07aead9df4fc8
Author: Zachary <mazengxie@126.com>
Date: Tue Nov 7 09:09:48 2017 +0800

    ovs-fw: catches exception from ovsdb

    OVS agent will raise an exception when deleting
    multiple vms in bulk. Nova will delete tap when vms are
    removed. Then, ovs agent checks ovs_port
    by calling "self.get_ovs_port", and the exception will be raised.
    The patch will catch exception.

    Change-Id: Ief7de22e5f85253d8a25ecfbb139a8f87c1a0b35
    Closes-Bug: #1729213
    (cherry picked from commit 364e5db586a93902e99f68a8e213ad9b2a9f39b5)

tags: added: in-stable-pike
tags: added: neutron-proactive-backport-potential
tags: added: ovs-fw
removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.3

This issue was fixed in the openstack/neutron 11.0.3 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.