nova boot operation with servers greater then 63 characters don't get DHCP address

Bug #1238910 reported by Steven Dake
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Chet Burgess

Bug Description

If a server with greater then 63 characters is attempted to be booted, the servers will boot but fail to obtain DHCP addresses with nova networking and neutron. dnsmsq is fully configured for the full server name, however, Linux has a 64 character hostname limit.

[sdake@bigiron ~]$ getconf HOST_NAME_MAX
64

Recommend a nova exception if a server greater then 63 characters is created so the user is aware of the problem at the api level rather then wondering why their vm doesn't appear to work.

Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/51390

Changed in nova:
status: New → In Progress
Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

nova-network generates invalid entries in the dnsmasq hosts file when the hostname of the instance is longer than 63 characters.

$ cat /opt/stack/data/nova/networks/nova-br100.conf
fa:16:3e:6c:93:03,testvm1.novalocal,10.0.0.2
fa:16:3e:50:95:a8,testvm1hejazkhejkazehjzakhejazklehazjklehazjklehazjklehazjkelhazjelhazjelhazjeklazhejklazhejkazlehjazklehazjklehazjkelhazjeklazhej.novalocal,10.0.0.3

$ grep dnsmasq /var/log/syslog
Oct 16 12:12:22 r421-e3-4 dnsmasq-dhcp[15975]: DHCPDISCOVER(br100) fa:16:3e:6c:93:03
Oct 16 12:12:22 r421-e3-4 dnsmasq-dhcp[15975]: DHCPOFFER(br100) 10.0.0.2 fa:16:3e:6c:93:03
Oct 16 12:12:24 r421-e3-4 dnsmasq-dhcp[15975]: DHCPDISCOVER(br100) fa:16:3e:50:95:a8 no address available

As per RFC 1035:
The labels must follow the rules for ARPANET host names. They must
start with a letter, end with a letter or digit, and have as interior
characters only letters, digits, and hyphen. There are also some
restrictions on the length. Labels must be 63 characters or less.

The problem was found while investigating bug #1238272.

Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

As noted in bug #1238272, I couldn't reproduce the error with Neutron. But for sure there is an issue with dnsmasq configuration in nova-network.

Revision history for this message
Joe Gordon (jogo) wrote :
Changed in nova:
status: In Progress → Opinion
Revision history for this message
Chet Burgess (cfb-n) wrote :

Bring this one back from the dead since i just hit it with a client.

I agree with Dan Smith's comments in the review that the API shouldn't limit this. Where I disagree is that we *should* fix this in nova-network. The assertion that we should allow 255 character DNS names in nova-network is all well and good except the *only* implementation for DHCP in nova-network is with dnsmasq and it has a 63 character limit. As such the code that generates the dnsmasq host file for nova-network should implement some type of semi-intelligent truncation strategy, its better then outright breaking.

Since I'm going to be fixing this locally in our code base I'll upstream our work as well.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/136477

Changed in nova:
assignee: Jay Lau (jay-lau-513) → Chet Burgess (cfb-n)
status: Opinion → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/136477
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f58e1fd6c701132297c01af4eb239284ef4c2e7d
Submitter: Jenkins
Branch: master

commit f58e1fd6c701132297c01af4eb239284ef4c2e7d
Author: Chet Burgess <email address hidden>
Date: Fri Nov 21 10:02:53 2014 -0800

    Fix long hostname in dnsmasq

    dnsmasq only supports 63 character hostnames. Longer names cause
    dnsmasq to ignore the entry and not hand out a DHCP address.

    Trunacte hostnames longer then 63 characters in order to make
    DHCP work.

    Closes-Bug: #1238910
    Change-Id: Ie1697577bc14038faccd50caf2fea20cac342388

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