← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1535554] Re: Multiple dhcp agents are scheduled to host one network automatically if multiple subnets are created at the same time

 

Reviewed:  https://review.opendev.org/288271
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=69b3762dda47272513e02340e7942d5a39f825c5
Submitter: Zuul
Branch:    master

commit 69b3762dda47272513e02340e7942d5a39f825c5
Author: Lujin <luo.lujin@xxxxxxxxxxxxxx>
Date:   Thu Mar 16 15:42:47 2017 +0900

    Add binding_index to NetworkDhcpAgentBinding
    
    The patch proposes adding a new binding_index to the
    NetworkDhcpAgentBinding table, with an additional Unique
    Constraint that enforces a single <network_id, binding_index>
    per network.
    
    1. When a network is triggered to be auto-scheduled to DHCP
    agents, the number of DHCP agents is constrained by
    dhcp_agents_per_network in neutron.conf. This prevents
    too many DHCP agents from being scheduled in the first place.
    
    2. If users manually schedule a network to specific DHCP
    agents, the binding_index increments to show the number of
    DHCP agents hosting this network.
    
    Co-Authored-By: Oleg Bondarev <obondarev@xxxxxxxxxxxx>
    Change-Id: I1bc3f8b69c337f7c1cf7375509a0da61def9baf1
    Closes-Bug: #1535554


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1535554

Title:
  Multiple dhcp agents are scheduled to host one network automatically
  if multiple subnets are created at the same time

Status in neutron:
  Fix Released

Bug description:
  I have three all-in-one controller nodes deployed by DevStack with the
  latest codes. Neutron servers on these controllers are set behind
  Pacemaker and HAProxy to realize active/active HA. MariaDB Galera
  cluster is used as my database backend.

  In neutron.conf, I have made the following changes:
  dhcp_agents_per_network = 1
  network_scheduler_driver = neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler

  Since I only allow one dhcp agent per tenant on each controller, now I
  have three dhcp agents in total for a given tenant. After I created
  one network within this given tenant, before I add any subnets to this
  network, no dhcp agents would be scheduled to host this network. If I
  run multiple commands at the same time to add subnets to the network,
  we may end up with more than one dhcp agents hosting the network.

  It is not easy to re-produce the bug. You might need to repeat the
  following steps multiple times.

  How to reproduce:

  Prerequisite
  make the following changes in neutron.conf
  [DEFAULT]
  dhcp_agents_per_network = 1
  network_scheduler_driver = neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler

  Step 1: Confirm multiple dhcp agents are running
  $ neutron agent-list --agent_type='DHCP agent'
  my result is shown http://paste.openstack.org/show/483956/

  Step 2: Create a network
  $ neutron net-create net-dhcptest

  Step 3: Create multiple subnets on the network at the same time
  On controller1:
  $ neutron subnet-create --name subnet-dhcptest-1 net-dhcptest 192.162.101.0/24
  On controller2:
  $ neutron subnet-create --name subnet-dhcptest-2 net-dhcptest 192.162.102.0/24

  Step 4: Check which dhcp agent(s) is/are hosting the network
  $ neutron dhcp-agent-list-hosting-net net-dhcptest
  my result is shown http://paste.openstack.org/show/483958/

  If you end up with only one dhcp agent, please delete the subnets and
  network. Then repeat Step 1-4 several times.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1535554/+subscriptions


References