← Back to team overview

openstack team mailing list archive

metadata for instances

 

Hello,

I'm investigating various loose ends for a pending open stack
deployment, and one of the things I'd like to be able to do is to affect
the hostname in the instance metadata (for instance in the metadata
returned by nova-api-metadata on the compute nodes).   This metadata has
various meanings in our puppet config, so having some influence over it
would be useful to us.  What I'm aiming for, roughly is something like
what the ec2 facts in puppet give you back when running on aws,
something like:

ec2_hostname => ip-10-226-51-162.eu-west-1.compute.internal
ec2_local_hostname => ip-10-226-51-162.eu-west-1.compute.internal
ec2_local_ipv4 => 10.226.51.162
ec2_public_hostname => ec2-79-125-8-220.eu-west-1.compute.amazonaws.com
ec2_public_ipv4 => 79.125.8.220

It seems like there is some provision for this:
nova/compute/api.py:

        display_name = instance.get('display_name')
        if display_name is None:
            display_name = self._default_display_name(instance_id)

        hostname = instance.get('hostname')
        if hostname is None:
            hostname = display_name

but instance can't have display_name or hostname set at create time, as
the api doesn't allow for it, so both always end up as 'server NN' as
far as I can tell.

Am I missing a knob to tweak?  I don't mind maintaining a small local
patch set to generate a different _default_display_name, but it seems
like it might be nicer to have this be templateable.

Cheers,
-- 
Stephen Gran
Senior Systems Integrator - guardian.co.uk

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - newspaper of the year

www.guardian.co.uk    www.observer.co.uk     www.guardiannews.com 

On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone
 
To save up to 30% when you subscribe to the Guardian and the Observer
visit www.guardian.co.uk/subscriber 
---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited

A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP

Registered in England Number 908396