KeyError: 'gateway_mac' in ovs dvr agent

Bug #1403333 reported by Armando Migliaccio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned
Changed in neutron:
importance: Undecided → Medium
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/142697

Changed in neutron:
assignee: nobody → Swaminathan Vasudevan (swaminathan-vasudevan)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Kyle Mestery (<email address hidden>) on branch: master
Review: https://review.openstack.org/142697
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Assaf Muller (amuller) wrote :

Here's a reliable but somewhat silly way to reproduce this (I don't know what Tempest test would do this, this requires more investigation, or perhaps this isn't the only reproducer):

Create network, subnet, distributed router
Attach router to subnet but give it a different IP address than the subnet's gateway_ip, this can be accomplished by:
1) Horizon has an optional field that lets you specify the router's IP on the subnet
2) Via the CLI, create a port with a custom fixed IP, then attach it to the router
3) Boot a VM on the network, so that the node will have a port bound to it
4) Set the router as a gateway. This will start an error loop.

in _bind_distributed_router_interface_port, you get KeyError: 'ip_version'
in _bind_centralized_snat_port_on_dvr_subnet you get KeyError: 'gateway_mac'

Observing the code, this happens because when you set a DVR router as a gateway, an internal SNAT port is allocated, and the OVS agent executes _bind_centralized_snat_port_on_dvr_subnet, which calls:

subnet_info = self.plugin_rpc.get_subnet_for_dvr(self.context, subnet_uuid)

subnet_info will return as None, and the following couple of lines populates the local subnets cache with None. This means that any other code that retrieves this subnet from the cache (In the same method, or other methods that plug VM/DHCP ports, as well as regular distributed ports) will retrieve None and fail on KeyErrors.

Revision history for this message
Assaf Muller (amuller) wrote :

Sorry the above comment makes more sense if you remove '3)' and '4)' but keep their respective lines.

Revision history for this message
Assaf Muller (amuller) wrote :

Following my investigation and conversation with Swami, closing this bug as a duplicate of:
https://bugs.launchpad.net/neutron/+bug/1404823

Changed in neutron:
status: In Progress → Invalid
importance: Medium → Undecided
assignee: Swaminathan Vasudevan (swaminathan-vasudevan) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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