dhcp_agents_per_network does not work appropriately.

Bug #1388698 reported by kazuhiro MIYASHITA on 2014-11-03
This bug affects 6 people
Affects Status Importance Assigned to Milestone

Bug Description

# Number of DHCP agents scheduled to host a network. This enables redundant
# DHCP agents for configured networks.
# dhcp_agents_per_network = 1
dhcp_agents_per_network = 1

  A) multiple network nodes.
  B) dhcp-agents are alives in each network nodes.
  C) one network is hosted by one dhcp-agent.

     network node1: dhcp-agent1 hosts network1.
     network node2: dhcp-agent2 hosts nothing.


1) stop dhcp-agent1.
2) port create ysing network1
3) start dhcp-agent1.


     network node1: dhcp-agent1 hosts network1.
     network node2: dhcp-agent2 hosts network1.

Changed in neutron:
assignee: nobody → Eugene Nikanorov (enikanorov)
importance: Undecided → High
tags: added: l3-ipam-dhcp
Changed in neutron:
assignee: Eugene Nikanorov (enikanorov) → nobody
Changed in neutron:
assignee: nobody → Hironori Shiina (shiina-hironori)
Changed in neutron:
assignee: Hironori Shiina (shiina-hironori) → watanabe.isao (watanabe.isao)
status: New → In Progress
Changed in neutron:
assignee: nobody → watanabe.isao (zouyun)
watanabe.isao (watanabe.isao) wrote :

>dhcp_agents_per_network option means "active_dhcp_agents_per_network" or "dhcp_agents_per_network"?
We will fix this bug, from "active_dhcp_agents_per_network" to "dhcp_agents_per_network".

Change abandoned by watanabe isao (<email address hidden>) on branch: master
Review: https://review.openstack.org/138659

watanabe.isao (watanabe.isao) wrote :
Changed in neutron:
status: In Progress → Invalid
Itsuro Oda (oda-g) wrote :


I don't think it is fixed by 131150 because 131150 removes non active agents only.
If an agent was down incidentally and a network was scheduled to another agent during the agent was down and the agent becomes active again, the network may be scheduled to more than dhcp_agents_per_network agents.

watanabe.isao (watanabe.isao) wrote :

Hello, @Itsuro Oda (oda-g)

131150 do removes non active agents, it also removes networks from dead agents.
Please see the following part of the fix
 - https://review.openstack.org/#/c/131150/
  - neutron/db/agentschedulers_db.py
   - self.setup_agent_status_check(self.remove_networks_from_down_agents)

I've tested about this in a multi-network-node environment.

Itsuro Oda (oda-g) wrote :


I mean the following case:

1) an agent was down and its state is shown as 'non active'
2) scheduling occur (ex. by creating port). a network is scheduled to another agent because 'non active' agent is not counted.
3) the agent is up again before 'peoderic dead agent check task' is noticed the agent was down.

Changed in neutron:
status: Invalid → Incomplete
watanabe.isao (watanabe.isao) wrote :

Hello, @Itsuro Oda (oda-g).

Thanks for the case describe. I will confirm about your case. It will cost a couple of time. If you have already tested your case, it would be a great help to me if you can put some evidence here.

Itsuro Oda (oda-g) wrote :


I only thought logically. I look forward to that you test it :)

watanabe.isao (watanabe.isao) wrote :

Hello, @Itsuro Oda (oda-g).

Tested that the problem happened by your case.
Also tested my previous work can deal with the problem.
I will restart the gerrit work.
Thanks for your help very much.

Changed in neutron:
status: Incomplete → In Progress
description: updated
Miguel Lavalle (minsel) wrote :

A fix has been proposed for this bug:


watanabe.isao (watanabe.isao) wrote :

Hello, @Miguel Lavalle (minsel)
Thank you for the update.
The fix has been abandoned once, but seems like launchpad did not catch the restore action on gerrit. :-)

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

commit b095fa11a4df221a5d539d142bd3c0340935ad9d
Author: watanabe isao <email address hidden>
Date: Wed Jun 24 18:15:31 2015 +0900

    Bug-Fix for unexpected DHCP agent redundant

    This fix let DHCP scheduler not looks at only active agents, but all
    available agents.
    This helps db module to remove dead agent, when rebinding, properly.

    Change-Id: I8534ddfae299724c05641183c2fe4c1c98c614e8
    Closes-Bug: 1388698

Changed in neutron:
status: In Progress → Fix Committed
Download full text (37.3 KiB)

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

commit 966203f89dee8fe61fb2dce654e36e510e80380f
Author: Sukhdev Kapur <email address hidden>
Date: Wed Jul 1 16:30:44 2015 -0700

    Neutron-Ironic integration patch

    This patch is in preparation for the integration
    of Ironic and Neutron. A new vnic_type is being
    added so that ML2 drivers can filter for all
    Ironic ports based upon match for 'baremetal'.
    Nova/Ironic will set this vnic_type when issuing
    port-create request to neutron.
    (e.g. binding:vnic_type = 'baremetal' )

    Change-Id: I25dc9472b31db052719db503a10c1fb1a55572ef
    Partial-Implements: blueprint neutron-ironic-integration

commit 236e408272bcb9b8e957524864e571b5afdc4623
Author: Oleg Bondarev <email address hidden>
Date: Tue Jul 7 12:02:58 2015 +0300

    DVR: fix router scheduling

    Fix scheduling of DVR routers to not stop scheduling once
    csnat portion was scheduled. See bug report for failing

    This partially reverts
    commit 3794b4a83e68041e24b715135f0ccf09a5631178
    and fixes bug 1374473 by moving csnat scheduling
    after general dvr router scheduling, so double binding does
    not happen.

    Closes-Bug: #1472163
    Related-Bug: #1374473
    Change-Id: I57c06e2be732e47b6cce7c724f6b255ea2d8fa32

commit e152f93878b9bb6af7cfedc9e045892fcf7d0615
Author: Assaf Muller <email address hidden>
Date: Sat Aug 8 21:15:03 2015 +0300

    TESTING.rst love

    Change-Id: I64b569048f8f87ea2fe63d861302b4020d36493d

commit 633c52cca1b383af2c900e1663c8682114acd177
Author: sridhargaddam <email address hidden>
Date: Wed Aug 5 10:49:33 2015 +0000

    Avoid dhcp_release for ipv6 addresses

    dhcp_release is only supported for IPv4 addresses [1] and not for
    IPv6 addresses [2]. There will be no effect when it is called with
    IPv6 address. This patch adds a corresponding note and avoids calling
    dhcp_release for IPv6 addresses.

    [1] http://manpages.ubuntu.com/manpages/trusty/man1/dhcp_release.1.html
    [2] http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q2/007084.html

    Change-Id: I8b8316c9d3d011c2a687a3a1e2a4da5cf1b5d604

commit 2de8fad17402f38bbc30204ee2f4f99cf21cb69d
Author: OpenStack Proposal Bot <email address hidden>
Date: Mon Aug 10 06:11:06 2015 +0000

    Imported Translations from Transifex

    For more information about this automatic import see:

    Change-Id: I2b423e83a7d0ac8b23239f81fe33dd8382c6fff6

commit fef79dc7b9162e03c8891645494c115b52d4d014
Author: Henry Gessau <email address hidden>
Date: Mon Aug 3 23:30:34 2015 -0400

    Consistent layout and headings for devref

    The lack of convention for heading levels among the independently
    written devref documents was starting to make the Table of Contents
    look rather messy when rendered in HTML.

    This patch does not cover the "Neutron Internals" section since its

tags: added: in-feature-pecan
Thierry Carrez (ttx) on 2015-09-03
Changed in neutron:
milestone: none → liberty-3
status: Fix Committed → Fix Released

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

commit c74b05ebb1d2ee717df196a6d866e87435d30ac3
Author: watanabe isao <email address hidden>
Date: Wed Jun 24 18:15:31 2015 +0900

    Bug-Fix for unexpected DHCP agent redundant

    This fix let DHCP scheduler not looks at only active agents, but all
    available agents.
    This helps db module to remove dead agent, when rebinding, properly.

    Change-Id: I8534ddfae299724c05641183c2fe4c1c98c614e8
    Closes-Bug: 1388698
    (cherry picked from commit b095fa11a4df221a5d539d142bd3c0340935ad9d)

tags: added: in-stable-kilo
Thierry Carrez (ttx) on 2015-10-15
Changed in neutron:
milestone: liberty-3 → 7.0.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers