On 03/31/2015 01:51 AM, James Buckett wrote:
> 
> Hello OpenStack Community.
> .
> I would like to ask for comments on how to insert a hostname into to an
> instance using cloud-init.
> .
> I am using a pool of assign IP addresses that have hostnames assigned in
> DNS.
> .
> Thanks In Advance.
> .
> James Buckett
> IBM Cloud Consultant
> IBM Cloud Software Services
> Mobile:  +61-434-078-044
> e-Mail: [email protected]

It depends (tm).

If the hostname is in the instance metadata then you can just call the
metadata service in your init script and put the result in /etc/hostname.

If it's more like how AWS makes a hostname (1-2-3-4-ec2-internal)
programmatically from an IP address, then you can just get the IP
address and manipulate it with awk/sed/whatever to the format you like.

-- 
Ryan Brown / Software Engineer, Openstack / Red Hat, Inc.

_______________________________________________
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

Reply via email to