duplicate dhcp port when deleting original dhcp port and restart dhcp-agent

Bug #1339968 reported by Xurong Yang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Oleg Bondarev

Bug Description

my use case is as follows:
1.delete dhcp port
2.restart dhcp-agent

then, there will be two dhcp ports.

Sayaji Patil (sayaji15)
Changed in neutron:
assignee: nobody → Sayaji Patil (sayaji15)
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

Please provide more detailed description of your scenario:
- what commands have been run
- what output you see (how did you determine that there are 2 dhcp ports)

Changed in neutron:
status: New → Incomplete
Revision history for this message
Itzik Brown (itzikb1) wrote :
Download full text (6.2 KiB)

I also encountered the same problem.

1. Commands to run:
     neutron port-delete <port-id>
     Restart dhcp-agent

2. The way I see the duplicate dhcp ports:

$ neutron port-list --device_owner=network:dhcp
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------------+
| 45cd52d3-9566-426d-ad21-aec82d39fbe0 | | fa:16:3e:7b:1a:eb | {"subnet_id": "3fe70668-3c5b-42b4-93a3-edb158eb7598", "ip_address": "192.168.50.100"} |
| e4bd5c9c-91f3-45da-9648-8661a6ff41a8 | | fa:16:3e:a1:6a:e3 | {"subnet_id": "3fe70668-3c5b-42b4-93a3-edb158eb7598", "ip_address": "192.168.50.101"} |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------------+

It's same subnet ID with two DHCP ports.
The two ports have also the same host-id.

$ neutron port-show 45cd52d3-9566-426d-ad21-aec82d39fbe0
+-----------------------+---------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | r-dcs73 |
| binding:profile | {} |
| binding:vif_details | {"port_filter": true, "ovs_hybrid_plug": true} |
| binding:vif_type | ovs |
| binding:vnic_type | normal |
| device_id | dhcp932e585d-98e3-58f3-926f-1f9845da5761-68ad1aa6-f724-4ec1-b384-86bad3136b99 |
| device_owner | network:dhcp |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "3fe70668-3c5b-42b4-93a3-edb158eb7598", "ip_address": "192.168.50.100"} |
| id | 45cd52d3-9566-426d-ad21-aec82d39fbe0 |
| mac_address | fa:16:3e:7b:1a:eb |
| name | ...

Read more...

Changed in neutron:
status: Incomplete → Confirmed
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/122442

Changed in neutron:
assignee: Sayaji Patil (sayaji15) → Oleg Bondarev (obondarev)
status: Confirmed → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit d144cb8ff422e16c5917c87471a46fd095fd1856
Author: Oleg Bondarev <email address hidden>
Date: Thu Sep 18 18:39:43 2014 +0400

    Only setup dhcp interface if dhcp is not active on network

    When enabling (DhcpLocalProcess.enable()) dhcp for a network the agent
    first sets dhcp interface, then checks if dhcp is curently active and
    if it's true then the agent restarts dhcp.
    Restart (DhcpBase.restart()) first disables dhcp and then enables it again
    by calling DhcpLocalProcess.enable() recursively which in turn sets
    dhcp interface again (it doesn't see the port created earlier as network
    is not re-fetched from db). This leads to duplicate dhcp interface
    for the network.

    The fix is to only setup dhcp interface if dhcp is not active.

    Closes-Bug: #1339968

    Change-Id: I3a6d2fd5b18a97138ac5b699ecd4d4b30dbdbacb

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
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.