[Openstack] Mystery of VM's Hostname

Lars Kellogg-Stedman lars at redhat.com
Thu Dec 18 17:37:49 UTC 2014


On Thu, Dec 18, 2014 at 10:57:52PM +0530, Girija Sharan wrote:
> " curl http://169.254.169.254/openstak/latest/meta_data.json " from inside
> the VM (once it is launched), I am getting hostname, name, availability
> zone, etc etc. as output.
> ----> So here my question becomes : How this meta_data.json file is getting
> created and updated with these details. Details like Name, Availabitily
> zone, flavor, etc I am specifying while launching VM. But no where I am
> mentioning *hostname*. How in meta_data.json file 'hostname' field is
> getting updated/added.

These are set to the name you give your instance when it
boots.  The domain name (".novalocal") is configured in, e.g.,
nova.conf.

> Here, as you have mentioned, my question becomes : How does
> redhat/ubuntu/centos/etc set the hostname if has not been explicitly
> configured by the administrator?

I think I answered this for RedHat and derivatives; I'm not familiar
with how Ubuntu handles this.

> Also, In addition to above query, how does redhat/ubuntu/centos/etc set the
> hostname
> if has not been explicitly configured by the administrator and the VM
> launched didn't get the IP?

I think RedHat may simply default to "localhost.localdomain" if the
system does not have a configured hostname and is not able to reach
DNS, but I'm not sure.

I have no idea how Ubuntu behaves.

-- 
Lars Kellogg-Stedman <lars at redhat.com> | larsks @ {freenode,twitter,github}
Cloud Engineering / OpenStack          | http://blog.oddbit.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20141218/f8c00338/attachment.sig>


More information about the Openstack mailing list