BGP: DVR fip has next_hop to snat gateway after associate first time

Bug #1615919 reported by LIU Yulong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Ryan Tidwell

Bug Description

ENV:
stable/mitaka

When A DVR floating IP associate to a port, the `floatingip_update_callback` will immediately start a `start_route_advertisements` to notify DR agent that FIP bgp route.
But this bgp route is not right, its next_hop is set to snat gateway IP address.
And then after `periodic_interval` seconds, then the DR agent will resync that DVR fip route with new next_hop to the correct FIP namespace fg-device IP address.

Reproduce:
1. create a DVR router 1, set gateway
2. create a network/subnet, and connected to the DVR router 1
3. create a VM 1
4. bind a floating IP to that VM 1
5. in DR agent LOG, you may see the following infos:

2016-08-23 13:08:26.301 13559 INFO bgpspeaker.api.base [req-829d21e2-98c3-49f3-9ba5-bd626aaf782e - - - - -] API method network.add called with args: {'prefix': u'172.16.10.68/32', 'next_hop': u'172.16.6.154'}
2016-08-23 13:08:26.302 13559 INFO neutron.services.bgp.driver.ryu.driver [req-829d21e2-98c3-49f3-9ba5-bd626aaf782e - - - - -] Route cidr=172.16.10.68/32, nexthop=172.16.6.154 is advertised for BGP Speaker running for local_as=2345.
2016-08-23 13:08:37.131 13559 INFO bgpspeaker.api.base [req-fa420676-2ddd-4b24-9c36-932c2c8b1bef - - - - -] API method network.del called with args: {'prefix': u'172.16.10.68/32'}
2016-08-23 13:08:37.131 13559 INFO neutron.services.bgp.driver.ryu.driver [req-fa420676-2ddd-4b24-9c36-932c2c8b1bef - - - - -] Route cidr=172.16.10.68/32 is withdrawn from BGP Speaker running for local_as=2345.
2016-08-23 13:08:37.132 13559 INFO bgpspeaker.api.base [req-fa420676-2ddd-4b24-9c36-932c2c8b1bef - - - - -] API method network.add called with args: {'prefix': u'172.16.10.68/32', 'next_hop': u'172.16.10.66'}
2016-08-23 13:08:37.132 13559 INFO neutron.services.bgp.driver.ryu.driver [req-fa420676-2ddd-4b24-9c36-932c2c8b1bef - - - - -] Route cidr=172.16.10.68/32, nexthop=172.16.10.66 is advertised for BGP Speaker running for local_as=2345.

Tags: l3-bgp
LIU Yulong (dragon889)
description: updated
tags: added: l3-bgp
Revision history for this message
Ryan Tidwell (ryan-tidwell) wrote :

This is happening because we seem to be assuming a centralized router when emitting the registry event on FIP association. I'm now beginning to see the wisdom in not including the host route in the registry event. We should just look up the host route in the registry event handler in neutron-dynamic-routing. The host route will be wrong initially, but within ~60 seconds the resync in the agent should clean things up. If we're not seeing this get straightened out after a re-sync, that is indicative of an issue with the agent re-sync.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
tags: added: mitaka-backport-potential
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/372298

Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-dynamic-routing (master)

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

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Not critical to include in Mitaka.

tags: removed: mitaka-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by LIU Yulong (<email address hidden>) on branch: master
Review: https://review.openstack.org/372298
Reason: refactored here:

https://review.openstack.org/#/c/396015/5/neutron/db/l3_db.py

Changed in neutron:
assignee: LIU Yulong (dragon889) → Ryan Tidwell (ryan-tidwell)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-dynamic-routing (master)

Reviewed: https://review.openstack.org/372310
Committed: https://git.openstack.org/cgit/openstack/neutron-dynamic-routing/commit/?id=0980985b2f3590f60b4726a5419680a1d70f9ead
Submitter: Jenkins
Branch: master

commit 0980985b2f3590f60b4726a5419680a1d70f9ead
Author: LIU Yulong <email address hidden>
Date: Mon Sep 19 11:29:04 2016 +0800

    Let the bgp_plugin to query floating IP bgp next_hop

    When a dvr floating IP is associated to a port, the bgp plugin
    `floatingip_update_callback` will immediately send a notification
    `start_route_advertisements` to DR agent, there is a new floating
    IP bgp route.
    But this bgp route is not correct, its next_hop is set to dvr router
    snat gateway IP address. And then after `periodic_interval` seconds,
    the DR agent will resync that DVR fip route with new next_hop to the
    correct FIP namespace fg-device IP address.

    This patch will let the bgp_plugin to handle the floating IP bgp route
    next_hop query.

    Change-Id: Ic6bb7f4263c6e2da315178be2ed041eb7020c905
    Closes-bug: #1615919

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

This issue was fixed in the openstack/neutron-dynamic-routing 10.0.0.0b2 development milestone.

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

Reviewed: https://review.openstack.org/357722
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=46430ab9a04a34f310c0249f097b616e19d6810a
Submitter: Jenkins
Branch: master

commit 46430ab9a04a34f310c0249f097b616e19d6810a
Author: LIU Yulong <email address hidden>
Date: Fri Aug 19 16:27:21 2016 +0800

    Get rid of floating IP bgp next_hop query

    Based on neutron-dynamic-routing change:
    Ic6bb7f4263c6e2da315178be2ed041eb7020c905
    then neutron can get rid of floating IP bgp next_hop query.

    Related-Bug: #1615919
    Partially implements blueprint: bgp-spinout

    Change-Id: Iad7d9353a52922e956f2860e30ced3fb5672be48

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.