<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Hi Gerard,</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">
I am being told that there is now an iterator in OpenStack when you launch multiple machines with --num-instances but have not verified this myself as of yet. I will inquire and test further. I fully agree with your comments do not think you are doing 'it' wrong at all, just a point below:</div>
<div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">The hostname of the machine ideally should be related to the resolved public/floating ipv4 as you point out, but the unique hostname is also essential to a machine that might not be exposed externally on that specific network while still being part of intra-instances communications on the internal/private 10.X.X.X like network (think multi-tiered applications for example where a database machine is a datastore for another and does not need to be exposed publicly. Best practices in IaaS and OpenStack are to use the internal/private network for this). Maybe this could maybe be done with multiple 'views' in DNS, and match/map all of them (public/floating ip space, internal/private ip space and hostnames)?</div>
<div class="gmail_default" style="font-family:georgia,serif"><br></div>
<div class="gmail_default" style="font-family:georgia,serif"> </div>
<div class="gmail_default" style="font-family:georgia,serif">Cheers</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Boris</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 16, 2013 at 9:18 PM, Gerard Bernabeu <span dir="ltr"><<a href="mailto:gerard1@fnal.gov" target="_blank">gerard1@fnal.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi,<br>
<br>
we are using cloud-init to do the VM host contextualization (ie:
set the right hostname). For this to work we need proper OpenStack
metadata, for instance we'd like the public-hostname to default to
the DNS resolved public-ipv4 (or ipv6, if present). <br>
<br>
Right now the default behaviour is that public-hostname is the
same as the hostname and the local-hostname, which is the
user-defined instance name. I'm not sure if current behaviour is a
bug or a feature, but I'd expect public-hostname to be related to
public-ipv4.<br>
<br>
Maybe we're missing something obvious or doing something wrong,
are we? If not, is there any way we can setup OpenStack (NOVA?) to
setup the public-hostname metadata to the resolved public-ipv4
name automatically for each VM?<br>
<br>
Thanks,<br>
<pre cols="72">Gerard Bernabeu
FermiCloud and FermiGrid Services at Fermilab
Phone <a href="tel:%28%2B1%29%20630-840-6509" value="+16308406509" target="_blank">(+1) 630-840-6509</a></pre><div><div class="h5">
On 09/15/2013 07:54 PM, laclasse wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-family:georgia,serif">Agreed,
unique FQDNs on every instances is still a big issue for
common workloads, hopefully solved by DNS services coming to
OpenStack soon... I fully agree that the instance name and the
FQDN of the instances should be 2 separate things, and even
better, I think instances by default should try a reverse
lookup first when they get on the network, and if available,
collect a hostname, set it locally and display it in an
additional column in the DB/tables/webUI, and allows OpenStack
services clients to use either instance ID, name or hostname.</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">What
the OP is trying to do is also feasible by installing a bind
service somewhere on the same subnet (bind9 minimum) and using
the $GENERATE directive in your zone file, see here on how to
write your zone file using that directive: <a href="http://www.oit.uci.edu/dcslib/bind/bind-9.2.1/Bv9ARM.ch06.html#AEN4097" target="_blank">http://www.oit.uci.edu/dcslib/bind/bind-9.2.1/Bv9ARM.ch06.html#AEN4097</a></div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default"><span style="font-family:georgia,serif">FWIW, AWS EC2 has a simple
iterator that composes a unique hostname to any instance by
parsing the public IP address, replacing '.' (dots) with '-'
(to make it viable in a long hostname) and adding
prefix/suffix to compose the hostname (compute zones and
domain) with added dots for example: "</span><font face="georgia, serif"><a href="http://ec2-54-211-89-105.co" target="_blank">ec2-54-211-89-105.co</a></font><span style="font-family:georgia,serif"><a href="http://mpute-1.amazonaws.com" target="_blank">mpute-1.amazonaws.com</a>"
is an instance with IP 54.211.89.105 ... it a simple and
useful solution. You can check it yourself:</span></div>
<div class="gmail_default"><span style="font-family:georgia,serif"><br>
</span></div>
<div class="gmail_default">
<div class="gmail_default"><font face="georgia, serif">$ host
54.211.89.105</font></div>
<div class="gmail_default">
<font face="georgia, serif">105.89.211.54.in-addr.arpa
domain name pointer <a href="http://ec2-54-211-89-105.compute-1.amazonaws.com" target="_blank">ec2-54-211-89-105.compute-1.amazonaws.com</a>.</font></div>
</div>
<div class="gmail_default">
<br>
</div>
<div class="gmail_default"><font face="georgia, serif">Not
having a unique FQDN on cloud instances can break many apps,
and DNS services in IaaS should not be taken for granted
(failure may happen), so IMHO, the best approach should be:</font></div>
<div class="gmail_default"><font face="georgia, serif">- boot
instance, get on the network, do a reverse look up on IP to
see if a DNS server answers with a FQDN , collect it and set
it</font></div>
<div class="gmail_default">
<font face="georgia, serif">- if the look up fails, then
resort to the iterator running and still end up with an
unique hostname per instance.</font></div>
<div class="gmail_default"><font face="georgia, serif"><br>
</font></div>
<div class="gmail_default"><font face="georgia, serif">It seems
a lot of public services hide this issue by allowing to
launch only one instance at the time, but AFAIK, if you
launch several instances at once using the nova CLI, you
will end up with ALL instances having the same hostname
(which is the instance name you have given to nova CLI) ...
which breaks so many things it is not funny ... and is
generally not a good idea or best practices either.</font></div>
<div class="gmail_default"><font face="georgia, serif"><br>
</font></div>
<div class="gmail_default"><font face="georgia, serif">If this
functionality lands (very soon we hope), it will obviously
also allows users to deal with hostnames directly rather
than IP address, which in 2013, could give an archaic and
old fashioned unfinished impression to users.</font></div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><font face="georgia, serif">Cheers,
sorry for the mini-rant but I would think this is one of the
most urgent issues to address to see real automation and
large scale apps.</font></div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><font face="georgia, serif"><br>
</font></div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sun, Sep 15, 2013 at 12:39 PM, Tim
Bell <span dir="ltr"><<a href="mailto:Tim.Bell@cern.ch" target="_blank">Tim.Bell@cern.ch</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I don’t think there is a formal exit inside OpenStack to do
this. You may have to make a small patch to Nova.<br>
<br>
It would be an interesting feature to define a plug-in
architecture for this which would have several other uses.<br>
<div><br>
Tim<br>
<br>
> -----Original Message-----<br>
> From: Francesco Ceccarelli [mailto:<a href="mailto:ceccarel@fnal.gov" target="_blank">ceccarel@fnal.gov</a>]<br>
</div>
<div>
<div>> Sent: 14 September 2013 20:40<br>
> To: Tim Bell<br>
> Cc: <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
> Subject: Re: [Openstack] openstack meta-data<br>
><br>
> Hello,<br>
> thanks for the help! I hadn't seen the command in
the documentation, this can be helpful.<br>
> BTW my problem is to update metadata every time a
machine is launched.<br>
> For example let's talk about the hostname. Every
time I launch a machine, I would like to have
well-configured metadata, with the<br>
> parameter public-hostname already set to a
customized value. I don't want the instance name as
public-hostname.<br>
><br>
> I hope I was clear and thanks again for the help,
Francesco<br>
><br>
><br>
><br>
> On Sat, 2013-09-14 at 07:18 +0000, Tim Bell wrote:<br>
> > You can update the metadata associated with an
instance using the 'nova meta' command. However, this
only updates the metadata<br>
> (i.e.<br>
> > key value pairs) rather than the other
attributes.<br>
> ><br>
> > Changing the server name would not alter the
hostname of the VM, it would only alter the description
in Nova.<br>
> ><br>
> > Can you explain a little more what you would
like to be doing ?<br>
> ><br>
> > Tim<br>
> ><br>
> > > -----Original Message-----<br>
> > > From: Francesco Ceccarelli [mailto:<a href="mailto:ceccarel@fnal.gov" target="_blank">ceccarel@fnal.gov</a>]<br>
> > > Sent: 14 September 2013 00:11<br>
> > > To: <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
> > > Subject: [Openstack] openstack meta-data<br>
> > ><br>
> > > Is it possible to update instance
meta-data, for example to set the public hostname?<br>
> > ><br>
> > > Thanks in advance,<br>
> > > Francesco<br>
> > ><br>
> > ><br>
> > >
_______________________________________________<br>
> > > Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
> > > Post to : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
> > > Unsubscribe :<br>
> > > <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
><br>
<br>
</div>
</div>
<br>
_______________________________________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
Post to : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>