sanitize_hostname() fails to account for domain part

Bug #1614148 reported by Johannes Grassler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned

Bug Description

The function nova.utils.sanitize_hostname() sanitizes instance names to
make them suitable for use as host names. Among other things it contains
the function truncate_hostname() that truncates host names to a maximum
length of 63 characters. Unfortunately this truncation does not take
into account the host names' domain part (DEFAULT/dhcp_domain in
nova.conf).

Consequently, a 63 character host name plus a domain part (e.g.
`.novalocal`) will yield a 73 character net host name passed to
cloud-init inside the instance, which can cause problems with host name
setting code (this can prevent instances from deploying properly, see
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1432758 ).

The Heat project has code to handle this kind of problem, but it's more
of a stopgap measure:

https://github.com/openstack/heat/commit/8ac7fa02063386a8eb73380d83261f7174781383

I think the better place to fix this is Nova. Unlike Heat, Nova knows
the domain name it uses and can truncate host names enough to leave room
for the domain name.

Tags: hostname
Matt Dorn (madorn)
Changed in nova:
status: New → Confirmed
status: Confirmed → New
Revision history for this message
Johannes Grassler (jgr-launchpad) wrote :

I submitted a fix already (CI didn't post the link for some reason): https://review.openstack.org/#/c/356561/

Changed in nova:
assignee: nobody → Johannes Grassler (jgr-launchpad)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/356561
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in nova:
status: In Progress → New
assignee: Johannes Grassler (jgr-launchpad) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

Is this still an open issue? The patch is abandoned (and never seems to have passed grenade)

Changed in nova:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Compute (nova) because there has been no activity for 60 days.]

Changed in nova:
status: Incomplete → Expired
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.