Bug 983672 - Quantum Dnsmasq dhcp agent generates invalid hostnames for dnsmasq
Quantum Dnsmasq dhcp agent generates invalid hostnames for dnsmasq
Product: Fedora
Classification: Fedora
Component: openstack-quantum (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: lpeer
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-11 12:57 EDT by Jonathan Barber
Modified: 2015-09-12 18:56 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-02-17 11:05:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
OpenStack gerrit 39167 None None None Never

  None (edit)
Description Jonathan Barber 2013-07-11 12:57:27 EDT
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:

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

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)

How reproducible:

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:

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),
-                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 11:50:59 EDT
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

So it sounds like this may be a dnsmasq bug rather than a quantum/neutron bug.
Comment 2 Jonathan Barber 2013-07-23 13:14:52 EDT
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 15:58:01 EDT
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 11:37:11 EDT
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 13:51:30 EST
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 11:05:16 EST
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

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.