Bug 983672 - Quantum Dnsmasq dhcp agent generates invalid hostnames for dnsmasq
Summary: Quantum Dnsmasq dhcp agent generates invalid hostnames for dnsmasq
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-quantum
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: lpeer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-11 16:57 UTC by Jonathan Barber
Modified: 2015-09-12 22:56 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 16:05:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 39167 0 None None None Never

Description Jonathan Barber 2013-07-11 16:57:27 UTC
Description of problem:
Using quantum.agent.linux.dhcp.Dnsmasq as the dhcp_driver for the quantum-dhcp-agent service generates a dnsmasq hosts file with hostnames formatted like:
192-168-149-192.openstacklocal

However, dnsmasq rejects these hostnames:
$ dnsmasq -d --dhcp-host=192-168-149-192.openstacklocal,192.168.149.192

dnsmasq: bad command line options: bad DHCP host name
$

(because the hostname starts with a digit)

This causes dnsmasq to not respond to DHCP requests for any VMs.

Version-Release number of selected component (if applicable):
python-quantum-2013.1.1-5.fc19.noarch (from openstack-quantum-2013.1.1-5.fc19.src.rpm)
dnsmasq-2.66-7.fc19.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install openstack via packstack from upstream so it has quantum networking
2. Create networks/subnets with DHCP servers enabled
2. Create VMs on these networks

Actual results:
VMs don't get IPs, /var/log/messages such as:
Jul 11 11:51:26 cas01 dnsmasq[31505]: bad DHCP host name at line 1 of /var/lib/quantum/dhcp/3dcd9f5b-d02e-4b37-9322-fa22b2ecae97/host

/var/lib/quantum/dhcp/3dcd9f5b-d02e-4b37-9322-fa22b2ecae97/host contains:
fa:16:3e:ab:dd:8c,192-168-149-192.openstacklocal,192.168.149.192
fa:16:3e:f2:28:72,192-168-149-194.openstacklocal,192.168.149.194
fa:16:3e:8e:af:70,192-168-149-193.openstacklocal,192.168.149.193

Expected results:
VMs should get IPs.

Additional info:
I hacked /usr/lib/python2.7/site-packages/quantum/agent/linux/dhcp.py to remove the hostname from being included in the dnsmasq file (generated by the Dnsmasq._output_hosts_file method):

--- /usr/lib/python2.7/site-packages/quantum/agent/linux/dhcp.py.orig	2013-07-11 17:50:51.593980318 +0100
+++ /usr/lib/python2.7/site-packages/quantum/agent/linux/dhcp.py	2013-07-11 15:54:35.087212267 +0100
@@ -325,8 +325,8 @@
             for alloc in port.fixed_ips:
                 name = '%s.%s' % (r.sub('-', alloc.ip_address),
                                   self.conf.dhcp_domain)
-                buf.write('%s, %s, %s\n' %
-                          (port.mac_address, name, alloc.ip_address))
+                buf.write('%s,%s\n' %
+                          (port.mac_address, alloc.ip_address))
 
         name = self.get_conf_file_name('host')
         utils.replace_file(name, buf.getvalue())

Comment 1 Bob Kukura 2013-07-23 15:50:59 UTC
From RFC 1123:

2.1  Host Names and Numbers

      The syntax of a legal Internet host name was specified in RFC-952
      [DNS:4].  One aspect of host name syntax is hereby changed: the
      restriction on the first character is relaxed to allow either a
      letter or a digit.  Host software MUST support this more liberal
      syntax.


So it sounds like this may be a dnsmasq bug rather than a quantum/neutron bug.

Comment 2 Jonathan Barber 2013-07-23 17:14:52 UTC
Indeed, it looks like you're dead right! Still breaks my stuff though :)

The change appears to have been introduced by the patch "dnsmasq-2.66-Tighten_checks_in_legal_hostname.patch", which was introduced in 2.66-6.

Comment 3 Kyle Mestery 2013-07-24 19:58:01 UTC
FYI: I fixed this upstream in dnsmasq here [1], and also pushed a fix to Neutron here [2]. Both patches were accepted in their respective projects and are now upstream.

[1] http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q3/007369.html
[2] https://review.openstack.org/38376

Comment 4 Alan Pevec 2013-08-05 15:37:11 UTC
Also accepted in stable/grizzly, so Fedora will be fixed when rebased to 2013.1.3 (to be released this week).

Comment 6 Fedora End Of Life 2015-01-09 18:51:30 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-02-17 16:05:16 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.