IPs from dhcp disabled subnets are added to host file when multiple subnets

Bug #1316444 reported by Darragh O'Reilly
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Itsuro Oda

Bug Description

If a network has many subnets, and some have dhcp enabled and some don't, then ips from all subnets are added to the dnsmasq host file.

Step:
$ neutron net-create net44
$ neutron subnet-create net44 10.0.10.0/24 --name sub1 --enable_dhcp true
$ neutron subnet-create net44 10.0.20.0/24 --name sub2 --enable_dhcp false

$ neutron subnet-list --fields id --fields name
+--------------------------------------+----------------+
| id | name |
+--------------------------------------+----------------+
| 4e32d76e-4c3a-458c-a250-69856ac325c2 | sub1 |
| c5f0d5a4-227b-4f60-914f-88c6f1b03525 | sub2 |
| e2de152d-a6dc-431e-8ca4-758601161f84 | private-subnet |
+--------------------------------------+----------------+

$ neutron port-create net44 \
    --fixed-ip subnet_id=4e32d76e-4c3a-458c-a250-69856ac325c2 \
     --fixed-ip subnet_id=c5f0d5a4-227b-4f60-914f-88c6f1b03525
+-----------------------+----------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+----------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:vnic_type | normal |
| device_id | |
| device_owner | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "4e32d76e-4c3a-458c-a250-69856ac325c2", "ip_address": "10.0.10.2"} |
| | {"subnet_id": "c5f0d5a4-227b-4f60-914f-88c6f1b03525", "ip_address": "10.0.20.2"} |
| id | 86b2b51b-a0e3-4f74-bb7d-e76eab90c9ed |
| mac_address | fa:16:3e:c7:15:82 |
| name | |
| network_id | fab1f41e-d9a4-4ca9-bce3-bb5321822958 |
| security_groups | b572b0b9-2fe3-4651-a903-f0dfbaf1c433 |
| status | DOWN |
| tenant_id | 15a0f58023434a78a13bf44e277580ef |
+-----------------------+----------------------------------------------------------------------------------+

vagrant@devstack:~$ cat /opt/stack/data/neutron/dhcp/fab1f41e-d9a4-4ca9-bce3-bb5321822958/host
fa:16:3e:c7:15:82,host-10-0-10-2.openstacklocal,10.0.10.2
fa:16:3e:c7:15:82,host-10-0-20-2.openstacklocal,10.0.20.2

Tags: l3-ipam-dhcp
Changed in neutron:
assignee: nobody → Darragh O'Reilly (darragh-oreilly)
status: New → In Progress
tags: added: l3-ipam-dhcp
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Darragh O'Reilly (<email address hidden>) on branch: master
Review: https://review.openstack.org/90045

Changed in neutron:
importance: Undecided → Medium
status: In Progress → New
Changed in neutron:
status: New → Confirmed
assignee: Darragh O'Reilly (darragh-oreilly) → nobody
Itsuro Oda (oda-g)
Changed in neutron:
assignee: nobody → Itsuro Oda (oda-g)
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/145102

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit dc3ab47b21d444774bcc70fde6f6763c22dc8ae1
Author: Itsuro Oda <email address hidden>
Date: Tue Jan 6 09:35:25 2015 +0900

    Skip adding ips from non dhcp enabled subnets to hosts file

    If a network had a mix of dhcp and non dhcp enabled subnets,
    then ips from all subnets were added to the hosts file.
    This fix ensures only ips from dhcp enabled subnets are added.

    Closes-Bug: #1316444
    Change-Id: I673088f7be0fb16a27b09e07f8ac41d21d1ea4d4

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