<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">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 class="moz-signature" cols="72">Gerard Bernabeu
FermiCloud and FermiGrid Services at Fermilab
Phone (+1) 630-840-6509</pre>
      On 09/15/2013 07:54 PM, laclasse wrote:<br>
    </div>
    <blockquote
cite="mid:%3CCAFzKjYUD=Mp1ZrLCSHHT-p4tUuNAGcKf-xitumxz6K=rHOc+xA@mail.gmail.com%3E"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <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
            moz-do-not-send="true"
href="http://www.oit.uci.edu/dcslib/bind/bind-9.2.1/Bv9ARM.ch06.html#AEN4097">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 moz-do-not-send="true"
              href="http://ec2-54-211-89-105.co">ec2-54-211-89-105.co</a></font><span
            style="font-family:georgia,serif"><a moz-do-not-send="true"
              href="http://mpute-1.amazonaws.com">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 moz-do-not-send="true"
                href="http://ec2-54-211-89-105.compute-1.amazonaws.com">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 moz-do-not-send="true"
              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 class="im HOEnZb"><br>
              Tim<br>
              <br>
              > -----Original Message-----<br>
              > From: Francesco Ceccarelli [mailto:<a
                moz-do-not-send="true" href="mailto:ceccarel@fnal.gov">ceccarel@fnal.gov</a>]<br>
            </div>
            <div class="HOEnZb">
              <div class="h5">> Sent: 14 September 2013 20:40<br>
                > To: Tim Bell<br>
                > Cc: <a moz-do-not-send="true"
                  href="mailto:openstack@lists.openstack.org">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
                  moz-do-not-send="true" href="mailto:ceccarel@fnal.gov">ceccarel@fnal.gov</a>]<br>
                > > > Sent: 14 September 2013 00:11<br>
                > > > To: <a moz-do-not-send="true"
                  href="mailto:openstack@lists.openstack.org">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 moz-do-not-send="true"
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 moz-do-not-send="true"
                  href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
                > > > Unsubscribe :<br>
                > > > <a moz-do-not-send="true"
                  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 moz-do-not-send="true"
              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 moz-do-not-send="true"
              href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
            Unsubscribe : <a moz-do-not-send="true"
              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>
  </body>
</html>