DHCP agent fails to configure routed networks due to failure generating subnet options

Bug #1758952 reported by Miguel Lavalle
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Miguel Lavalle

Bug Description

In a routed networks environment, after the merge of https://review.openstack.org/#/c/468744, the dhcp agent attempts to generate subnet options for both local and non local subnets. If one of the non-local subnets is classified as isolated from the point of view of the metadata service, the following traceback occurs:

Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent [-] Unable to enable dhcp for 40dcd8c6-e4a1-4510-ac62-f37c11e65a5a.: KeyError: u'2cbde018-1c03-40f8-9d67-90a03c7ebd37'
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent Traceback (most recent call last):
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/dhcp/agent.py", line 144, in call_driver
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent getattr(driver, action)(**action_kwargs)
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 219, in enable
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent self.spawn_process()
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 446, in spawn_process
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent self._spawn_or_reload_process(reload_with_HUP=False)
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 455, in _spawn_or_reload_process
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent self._output_config_files()
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 499, in _output_config_files
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent self._output_opts_file()
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 872, in _output_opts_file
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent options, subnet_index_map = self._generate_opts_per_subnet()
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 933, in _generate_opts_per_subnet
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent subnet_dhcp_ip and subnet.ip_version == 4):
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent KeyError: u'2cbde018-1c03-40f8-9d67-90a03c7ebd37'
Mar 26 15:21:41 compute2 neutron-dhcp-agent[31181]: ERROR neutron.agent.dhcp.agent

This traceback is due to the fact that the non-local subnet in question has no interface in the DHCP agent namespace, so it is not found when:

subnet_dhcp_ip = subnet_to_interface_ip[subnet.id]

is executed

Miguel Lavalle (minsel)
Changed in neutron:
assignee: nobody → Miguel Lavalle (minsel)
importance: Undecided → Medium
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/556584

Changed in neutron:
status: New → In Progress
tags: added: l3-ipam-dhcp
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/556584
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=bb5138cff4e6c383d4d9e902423072a1493832b9
Submitter: Zuul
Branch: master

commit bb5138cff4e6c383d4d9e902423072a1493832b9
Author: Miguel Lavalle <email address hidden>
Date: Mon Mar 26 11:20:18 2018 -0500

    Fix DHCP isolated subnets with routed networks

    After the merge of [1], the DHCP agent will fail to configure a routed
    network when attempting to generate host routes for a non-local subnet
    that is also isolated from the point of view of the metadata service.
    This patch adds a check to make sure that the host route is not added
    for non-local subnets.

    [1] https://review.openstack.org/#/c/468744

    Change-Id: Ia03f538a7d2d10d600d9359da5b3a74532709d1f
    Closes-Bug: #1758952

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.0.0b1

This issue was fixed in the openstack/neutron 13.0.0.0b1 development milestone.

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/584264

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

Reviewed: https://review.openstack.org/584264
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c7e80a656e3f3b3b103cb2ffed6171d10e6d4cad
Submitter: Zuul
Branch: stable/queens

commit c7e80a656e3f3b3b103cb2ffed6171d10e6d4cad
Author: Miguel Lavalle <email address hidden>
Date: Mon Mar 26 11:20:18 2018 -0500

    Fix DHCP isolated subnets with routed networks

    After the merge of [1], the DHCP agent will fail to configure a routed
    network when attempting to generate host routes for a non-local subnet
    that is also isolated from the point of view of the metadata service.
    This patch adds a check to make sure that the host route is not added
    for non-local subnets.

    [1] https://review.openstack.org/#/c/468744

    Change-Id: Ia03f538a7d2d10d600d9359da5b3a74532709d1f
    Closes-Bug: #1758952
    (cherry picked from commit bb5138cff4e6c383d4d9e902423072a1493832b9)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.4

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.