Hi Lars, Thank you very much for your early and informative reply.
> If cloud-init is installed and is able to connect to the metadata service, cloud-init will set your hostname based on the value provided in the metadata. Here, in my case cloud-init is installed and is able to connect to meta-data service. But while launching the VM I am not specifying any meta-data. But if I am doing the command " 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. > If cloud-init is *not* installed or is *not* able to connect to the metadata service, the hostname you end up with is going to depend on whatever distribution you happen to be booting. 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? 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 mean, If VM didn't get the IP and hostname was not been configured by admin, even then would the hostname be like host-<ip address> ex :- ' host-21-0-0-5 ' ?) Thank you once again. On Thu, Dec 18, 2014 at 9:16 PM, Lars Kellogg-Stedman <[email protected]> wrote: > > > *2).* Please do point me to any helpful links from where I can get > > understanding of VM's hostname mechanism. > > I'm not sure what you're asking here. > > If cloud-init is installed and is able to connect to the metadata > service, cloud-init will set your hostname based on the value provided > in the metadata. > > If cloud-init is *not* installed or is *not* able to connect to the > metadata service, the hostname you end up with is going to depend on > whatever distribution you happen to be booting (that is, at this point > you no long have an openstack question, you have "how does > redhat/ubuntu/etc set the hostname if has not been explicitly > configured by the administrator?"). > > On RHEL-ish systems (centos, fedora, etc), if the hostname is set to > the default "localhost.localdomain", the system will use reverse dns > to determine the name. This behavior may be different on other > distributions. > > -- > Lars Kellogg-Stedman <[email protected]> | larsks @ > {freenode,twitter,github} > Cloud Engineering / OpenStack | http://blog.oddbit.com/ > >
_______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : [email protected] Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
