The behaviour of python gethostname differs from Linux to Windows

Bug #1055503 reported by Luis Fernández Álvarez
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Low
Unassigned

Bug Description

The standard behaviour of the 'gethostname' function in Python differs from Linux to Windows. A common Linux configuration will return the fully qualified name, while a Windows one will return only the host name.

This problem leads to an inconsistent node naming in deployments that mix windows and linux nodes.

To make things more homogeneus among windows and linux compute nodes, it is proposed to use 'getfqdn' as default function instead of 'gethostname'. This function is more predictable in all cases.

Changed in nova:
assignee: nobody → Luis Fernandez (luis-fernandez-alvarez)
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/13636

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/13636
Committed: http://github.com/openstack/nova/commit/5dd1553cca7f7e62eebce75e1d936fc211b239ec
Submitter: Jenkins
Branch: master

commit 5dd1553cca7f7e62eebce75e1d936fc211b239ec
Author: Luis Fernandez Alvarez <email address hidden>
Date: Tue Sep 25 17:33:59 2012 +0200

    Replaced default hostname function from gethostname to getfqdn

    Fixes bug 1055503

    The standard behaviour of the 'gethostname' function in Python differs from
    Linux to Windows. A common Linux configuration returns the FQDN, while a
    Windows one returns only the host name.

    To resolve inconsistent node naming in deployments that mix windows and
    Linux, it is proposed to use 'getfqdn' as default function instead of
    'gethostname'. This is function is more predictable in all cases.

    Change-Id: I3164d9a36df2b8484bbf9a57879c31fa0e342503

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Revision history for this message
Michael Still (mikal) wrote :

I have had to revert this because it broke grizzly upgrades. I'm going to work on another fix though.

(The upgrade breakage was because services ended up being registered twice, as well as the host column of the instances table being wrong).

Changed in nova:
status: Fix Released → In Progress
assignee: Luis Fernandez (luis-fernandez-alvarez) → Michael Still (mikalstill)
importance: Undecided → High
Michael Still (mikal)
Changed in nova:
milestone: grizzly-1 → grizzly-rc1
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/24177

Revision history for this message
Michael Still (mikal) wrote :

Retargeting this because of risk and the existence of a work around (setting the host flag to something explicit).

Changed in nova:
milestone: grizzly-rc1 → havana-1
Changed in nova:
milestone: havana-1 → havana-2
Changed in nova:
milestone: havana-2 → havana-1
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → havana-2
Michael Still (mikal)
Changed in nova:
milestone: havana-2 → havana-3
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → havana-rc1
Revision history for this message
Russell Bryant (russellb) wrote :

and now it's probably too late to mess with for havana ...

Changed in nova:
status: In Progress → Incomplete
milestone: havana-rc1 → none
Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Hi guys, should we put this bug on track for Icehouse RC1 or at this point directly for J1?

Tom Fifield (fifieldt)
tags: added: ops
Revision history for this message
Sean Dague (sdague) wrote :

Marking as low as the preponderance of mixed os clusters is small.

Changed in nova:
importance: High → Low
status: Incomplete → Confirmed
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Please note, that HA deployments with Pacemaker & Corosync rely on "crm_node -n" instead. And this one could differ from getfqdn as well.

Michael Still (mikal)
Changed in nova:
assignee: Michael Still (mikalstill) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

I feel like this is firmly into the won't fix category. All the fixes so far have caused issues.

Changed in nova:
status: Confirmed → Won't Fix
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.