metadata service local-hostname is not fqdn

Bug #854614 reported by Scott Moser
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Scott Moser
Diablo
Fix Released
Undecided
Unassigned
nova (Ubuntu)
Fix Released
Medium
Scott Moser

Bug Description

On a nova instance of Ubuntu oneiric image 20110920 , where nova server is running ~ oneiric beta-1 code, I see:

$ ec2metadata --local-hostname
server-1013

on ec2, this gives a FQDN for the internal hostname.

Note, that in this particular case, there is a reverse lookup-able address:
$ host server-1013
server-1013.novalocal has address 10.55.60.13

I would like to see 'server-1013.novalocal' in the metadata service.

Revision history for this message
Scott Moser (smoser) wrote :

At least in this case, it looks like what I need is
  FLAGS.dhcp_domain
which is set in nova/network/linux_net.py .

but my simple patch to nova/api/ec2/cloud.py:
- hostname = instance_ref['hostname']
+ hostname = "%s.%s" % (instance_ref['hostname'], FLAGS.dhcp_domain)

resulted in
(nova.api.ec2.metadata): TRACE: Traceback (most recent call last):
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/api/ec2/metadatarequesthandler.py", line 79, in __call__
(nova.api.ec2.metadata): TRACE: meta_data = self.cc.get_metadata(remote_address)
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/api/ec2/cloud.py", line 329, in get_metadata
(nova.api.ec2.metadata): TRACE: hostname = "%s.%s" % (instance_ref['hostname'], FLAGS.dhcp_domain)
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/flags.py", line 144, in __getattr__
(nova.api.ec2.metadata): TRACE: val = gflags.FlagValues.__getattr__(self, name)
(nova.api.ec2.metadata): TRACE: File "/usr/lib/python2.7/dist-packages/gflags.py", line 935, in __getattr__
(nova.api.ec2.metadata): TRACE: raise AttributeError(name)
(nova.api.ec2.metadata): TRACE: AttributeError: dhcp_domain
(nova.api.ec2.metadata): TRACE:

I not sure that 'dhcp_domain' is actually what we want, but we want something.

Dave Walker (davewalker)
tags: added: server-o-rs
Dave Walker (davewalker)
Changed in nova (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
milestone: none → ubuntu-11.10
Revision history for this message
Scott Moser (smoser) wrote :
Changed in nova:
assignee: nobody → Scott Moser (smoser)
status: New → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : A change has been merged to openstack/nova

Reviewed: https://review.openstack.org/631
Committed: http://github.com/openstack/nova/commit/6415999523d26f1680265e5ca438020b7d6542c6
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 6415999523d26f1680265e5ca438020b7d6542c6
Author: Scott Moser <email address hidden>
Date: Fri Sep 23 16:44:44 2011 -0400

    put fully qualified domain name in local-hostname

    make metadata service return fully qualified domain name (fqdn) in
    the local-hostname field. (bug 854614)

    Also, move the dhcp_domain flag from being in nova.network.linux_net to be
    in the more common nova.network.manager. Since it is being used for
    something more generic, it shouldnt be stuck in linux_net.

    Change-Id: Ieab3cb1b7b0b78aff8df25bbc35b96924a8e7e60

Dave Walker (davewalker)
Changed in nova (Ubuntu):
assignee: nobody → Scott Moser (smoser)
status: Confirmed → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

fix-commited see comment 3.

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nova - 2011.3-0ubuntu3

---------------
nova (2011.3-0ubuntu3) oneiric; urgency=low

  [Adam Gandelman]
  * debian/nova-common.postinst: Create 'nova' group, add user to it
    (LP: #856530)
  * debian/nova.conf, debian/nova-compute.upstart.in: Move reference of
    nova-compute.conf from nova.conf to nova-compute's argv. (LP: #839796)

  [Chuck Short]
  * debian/patches/backport-recreate-gateway-using-dhcp.patch:
    Makes sure to recreate gateway for moved ip. (LP: #859587)
  * debian/control: Update Vcs info.

  [ Scott Moser ]
  * debian/patches/fqdn-in-local-hostname-of-ec2-metadata.patch
    Make the 'local-hostname' in the EC2 Metadata service contain
    the domainname also. (LP: #854614)
 -- Chuck Short <email address hidden> Tue, 27 Sep 2011 14:56:59 -0400

Changed in nova (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

Reviewed: https://review.openstack.org/934
Committed: http://github.com/openstack/nova/commit/44a2a648e7c26e3721e5ee6e28a0104458bceba3
Submitter: Jenkins
Branch: stable/diablo

 status fixcommitted
 done

commit 44a2a648e7c26e3721e5ee6e28a0104458bceba3
Author: Scott Moser <email address hidden>
Date: Fri Sep 23 16:44:44 2011 -0400

    put fully qualified domain name in local-hostname

    make metadata service return fully qualified domain name (fqdn) in
    the local-hostname field. (bug 854614)

    Also, move the dhcp_domain flag from being in nova.network.linux_net to be
    in the more common nova.network.manager. Since it is being used for
    something more generic, it shouldnt be stuck in linux_net.

    (cherry picked from commit 6415999523d26f1680265e5ca438020b7d6542c6)

    Change-Id: I1cc9266ad197f603bb434d77d944e10a6f4e91ba

Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Scott, or anyone else affected,

Accepted nova into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Dave Walker (davewalker)
tags: added: verification-done
removed: server-o-rs verification-needed
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-1 → 2012.1
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.