HA router can't be manually scheduled on L3 agent

Bug #1401095 reported by Mike Kolesnik
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
yong sheng gong
Kilo
New
Undecided
Unassigned

Bug Description

HA routers get scheduled automatically to L3 agents, you can view the router using l3-agent-list-hosting-router

$ neutron l3-agent-list-hosting-router harouter2
+--------------------------------------+------+----------------+-------+
| id | host | admin_state_up | alive |
+--------------------------------------+------+----------------+-------+
| 9c34ec17-9045-4744-ae82-1f65f72ce3bd | net1 | True | :-) |
| cf758b1b-423e-44d9-ab0f-cf0d524b3dac | net2 | True | :-) |
| f2aac1e3-7a00-47c3-b6c9-2543d4a2ba9a | net3 | True | :-) |
+--------------------------------------+------+----------------+-------+

You can remove it from an agent using l3-agent-router-remove, but when using l3-agent-router-add you get a 409:
$ neutron l3-agent-router-add bff55e85-65f6-4299-a3bb-f0e1c1ee2a05 harouter2
Conflict (HTTP 409) (Request-ID: req-22c1bb67-f0f8-4194-b863-93b8bb561c83)

The log says:
2014-12-10 07:47:41.036 INFO neutron.api.v2.resource [req-22c1bb67-f0f8-4194-b863-93b8bb561c83 admin f1bb80396ef34197b30117dfef45bea8] create failed (client error): The router 72b9f897-b84d-4270-a645-af38fe3bd838 has been already hosted by the L3 Agent 9c34ec17-9045-4744-ae82-1f65f72ce3bd.

Yoni Shafrir (yshafrir)
Changed in neutron:
assignee: nobody → Yoni (yshafrir)
tags: added: api l3-ha l3-ipam-dhcp
removed: ha l3agent router scheduling
Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
Assaf Muller (amuller)
tags: added: juno-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/143297

Changed in neutron:
status: Confirmed → In Progress
Assaf Muller (amuller)
tags: removed: l3-ipam-dhcp
Changed in neutron:
assignee: Yoni Shafrir (yshafrir) → Mike Kolesnik (mkolesni)
Changed in neutron:
assignee: Mike Kolesnik (mkolesni) → Nir Magnezi (nmagnezi)
Changed in neutron:
assignee: Nir Magnezi (nmagnezi) → yong sheng gong (gongysh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit c6d0e45c9fb07fab4edf9be3a11ca00c8ffd0b84
Author: Yoni Shafrir <email address hidden>
Date: Wed Dec 17 09:25:55 2014 +0200

    Fixed L3 agent manual scheduling for HA routers

    When a router is manually scheduled we check if a router can be scheduled
    to the given L3 agent. In this check we were missing handling for
    HA router, instead we raised an exception as a last resort.

    In addition, we create an HA port on the newly scheduled agent.
    The HA port is created within the router's namespace on that agent.
    Previously when manually scheduling this was not done at all.

    This patch takes care of HA routers by allowing them to be
    manually scheduled to a L3 agent if the router is not already
    scheduled to that given L3 agent.

    The patch also adds an HA port in the router's namespace on the newly
    scheduled L3 agent.

    In addition the patch also removes the 'max_l3_agents_per_router'
    enforcement when manually schedulling a router on a agent. This is
    done as the admin should be able to schedule a router on an agent
    if he desires, moreover this is consistent with the
    'min_l3_agents_per_router' that is not enforced when manually
    descheduling a router from an agent.

    Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>
    Co-Authored-By: Nir Magnezi <email address hidden>
    Closes-Bug: #1401095

    Change-Id: I1e2d281cfec50e7fff4ec68659882fc7c0cb4a29

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (feature/pecan)

Fix proposed to branch: feature/pecan
Review: https://review.openstack.org/207903

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (feature/pecan)
Download full text (70.7 KiB)

Reviewed: https://review.openstack.org/207903
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9badcd249dab2d3330f0cd608496b59c9f44499a
Submitter: Jenkins
Branch: feature/pecan

commit 991ea00e6c115343eabecc62e86072175823f81f
Author: Moshe Levi <email address hidden>
Date: Thu Jul 30 12:04:15 2015 +0300

    SR-IOV: Fix SR-IOV agent to run ip link commands as root

    Commit https://review.openstack.org/#/c/155523/
    remove the remaining root_helper args, but didn't
    update the SR-IOV agent to execute them as root.

    This patch updates the agent to execute ip link commands
    as root and pass options argument as a list in the
    self._as_root method.

    Closes-Bug: #1479694
    Change-Id: I53cafd61845a69fae3a759fb7526950d655ffa20

commit 5b3bacedf6c014815bef03c2e821b5eb8ef92dcb
Author: Saksham Varma <email address hidden>
Date: Thu Jul 23 22:46:23 2015 -0700

    Moved out cisco n1kv mech driver and db models

    Moving out Cisco N1Kv database models and the mech driver
    to the openstack/networking-cisco repo as part of the second
    phase vendor-core decomposition

    Partial-Bug: #1479123
    Partial-implements: blueprint core-vendor-decomposition

    Change-Id: I65a704b238d8cbe2951a6912fa4f1e8518c6f412

commit 65ac8cd0a80548e115b8ec1d4cfd47a94422fddf
Author: OpenStack Proposal Bot <email address hidden>
Date: Wed Jul 29 20:44:01 2015 +0000

    Updated from global requirements

    Change-Id: I3a884a73d51df0f93b5cc88b3e3250d81bb1f455

commit f0e8356d04d04600c072a1c0f0bdf274ff19ab8c
Author: sridhargaddam <email address hidden>
Date: Mon Jul 27 03:46:48 2015 +0000

    Update dhcp agent cache for network:dhcp ports

    When a network with a dhcp_enabled subnet is scheduled on a dhcp
    agent, dhcp driver creates the network:dhcp port for the subnet.
    However, the port info is not updated in dhcp agents internal cache.
    Subsequently if the user deletes the network:dhcp port, the port is
    properly deleted on the server side (i.e., in the database) and when
    the port_delete_end notification is sent to the dhcp agent, it simply
    ignores it as the port entry would be missing in the cache. This patch
    fixes this issue by updating the dhcp agents cache when dhcp driver
    creates the network:dhcp port for the subnets.

    Closes-Bug: #1478426
    Change-Id: I69f5834dd964a4320c606c4e0aa2cdba70416943

commit cb60d0bb4e0cc0cba68f59fdf5f4e89d6ec52950
Author: changzhi <email address hidden>
Date: Thu Jul 16 10:14:16 2015 +0800

    Keep dns nameserver order consistency

    Currently, there is no dns servers prioritization for subnets
    for Neutron.

    Generally speaking, it is useful to keep the order of dns
    nameservers consistent. Add a new column named 'order' in table
    'dnsnameservers' and add nameserver into DB one by one.

    Closes-Bug: #1218629
    Implements: blueprint keep-dns-nameserver-orderconsistency
    Change-Id: Id937aea411397d39370368a4eb45be26c4eefa9e

commit b39e1469e824bc8bc79e1ecafa98825a94811c0b
Author: Salvatore Orlando <email address hidden>
Date: Tue Jun 23 04:54:2...

tags: added: in-feature-pecan
Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-2 → 7.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/296339

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

Reviewed: https://review.openstack.org/296339
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e39d561448150a11be18ced28196facd77cb62a1
Submitter: Jenkins
Branch: stable/kilo

commit e39d561448150a11be18ced28196facd77cb62a1
Author: Yoni Shafrir <email address hidden>
Date: Wed Dec 17 09:25:55 2014 +0200

    Fixed L3 agent manual scheduling for HA routers

    When a router is manually scheduled we check if a router can be scheduled
    to the given L3 agent. In this check we were missing handling for
    HA router, instead we raised an exception as a last resort.

    In addition, we create an HA port on the newly scheduled agent.
    The HA port is created within the router's namespace on that agent.
    Previously when manually scheduling this was not done at all.

    This patch takes care of HA routers by allowing them to be
    manually scheduled to a L3 agent if the router is not already
    scheduled to that given L3 agent.

    The patch also adds an HA port in the router's namespace on the newly
    scheduled L3 agent.

    In addition the patch also removes the 'max_l3_agents_per_router'
    enforcement when manually schedulling a router on a agent. This is
    done as the admin should be able to schedule a router on an agent
    if he desires, moreover this is consistent with the
    'min_l3_agents_per_router' that is not enforced when manually
    descheduling a router from an agent.

    Conflicts:
     neutron/db/l3_agentschedulers_db.py
     neutron/scheduler/l3_agent_scheduler.py
     neutron/tests/unit/scheduler/test_l3_agent_scheduler.py

    Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>
    Co-Authored-By: Nir Magnezi <email address hidden>
    Closes-Bug: #1401095

    Change-Id: I1e2d281cfec50e7fff4ec68659882fc7c0cb4a29
    (cherry picked from commit c6d0e45c9fb07fab4edf9be3a11ca00c8ffd0b84)

tags: added: in-stable-kilo
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 2015.1.4

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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.