[Openstack] Mystery of VM's Hostname

Girija Sharan girijasharansingh at gmail.com
Fri Dec 19 06:59:58 UTC 2014


Hi Lars,

Thank you once again. You made it quite more clear. And now I have much
more understanding of all this.

But I still have some queries like :
> 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 hostname looks fine but, the domain name (novalocal), I am not
passing it any where. Even I didn't found it in any of the configuration
files.
Can you pin point where are we setting this value?


> > 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.
----> Here when my VM gets IP, it is getting some hostname (host-21-0-0-5
or dummya.novalocal, depending on cloud-init and metadata) but when it
didn't get IP, it is getting hostname as 'localhost'.
Can you share your thoughts on this behavior ?


On Thu, Dec 18, 2014 at 11:07 PM, Lars Kellogg-Stedman <lars at redhat.com>
wrote:
>
> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20141219/cc467688/attachment.html>


More information about the Openstack mailing list