<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    Le 4/17/12 11:57 PM, Pedro Vitti a écrit :
    <blockquote
cite="mid:CANhBZQRPcxFPFTAKhmt7sp5ot9Tpd-S-awm6Xp_7iOsp3pNzJQ@mail.gmail.com"
      type="cite">Hello,<br>
      <br>
      Are you sure that your init script is running at VM startup? <br>
      If so, be sure to 'source' the file context.sh that contains
      $HOSTNAME definition, before running your script.<br>
      <br>
      If you are using hdc as your device where the contextualization
      image will be available, you can use something like this at
      startup:<br>
      <br>
      <span style="color:rgb(0,0,0)">#!/bin/sh -e</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)"> </span><span
        style="color:rgb(0,0,0)"><br>
        mount -t iso9660 /dev/sdc /mnt</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)"> </span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)">if [ -f /mnt/context.sh ]; then</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)">  . /mnt/init.sh</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)">fi</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)"> </span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)">umount /mnt</span><br
        style="color:rgb(0,0,0)">
      <span style="color:rgb(0,0,0)"></span><span
        style="color:rgb(0,0,0)">exit 0<br>
        <br>
      </span>Take a look at last section (EXAMPLE) here: <a
        moz-do-not-send="true"
        href="http://opennebula.org/documentation:archives:rel3.2:cong">http://opennebula.org/documentation:archives:rel3.2:cong</a><br>
      For opensuse init script, read this: <a moz-do-not-send="true"
        href="http://www.novell.com/coolsolutions/feature/15380.html">http://www.novell.com/coolsolutions/feature/15380.html</a><br>
      <div class="gmail_quote"><br>
        Regars,<br>
        Pedro Vitti<br>
        <br>
        On Tue, Apr 17, 2012 at 5:56 AM, biro lehel <span dir="ltr"><<a
            moz-do-not-send="true" href="mailto:lehel.biro@yahoo.com">lehel.biro@yahoo.com</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <table border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td style="font: inherit;" valign="top">Hello again,<br>
                  <br>
                  I currently have an init script which I copy to the
                  newly instantiated VM using the template's
                  contextualization (FILES=.../init.sh). This script
                  contains (among others) the following section:<br>
                  <br>
                  <span
                    style="font-family:courier,monaco,monospace,sans-serif">if
                    [ -n "$HOSTNAME" ]; then</span><br
                    style="font-family:courier,monaco,monospace,sans-serif">
                  <span
                    style="font-family:courier,monaco,monospace,sans-serif">   
                    hostname $HOSTNAME</span><br>
                </td>
              </tr>
            </tbody>
          </table>
        </blockquote>
      </div>
    </blockquote>
    <br>
    Just as a hint, a hostname cannot contain underscores (maybe not
    your case but I once faced the issue....)<br>
    <br>
    Olivier<br>
    <blockquote
cite="mid:CANhBZQRPcxFPFTAKhmt7sp5ot9Tpd-S-awm6Xp_7iOsp3pNzJQ@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <table border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td style="font:inherit" valign="top">
                  <br>
                  HOSTNAME is also a contextualized parameter, as I set
                  HOSTNAME=MyHostName also in the contextualization
                  section of my VM's template.<br>
                  I would expect this to set my hostname as MyHostName
                  on the instantiated VM. However, the hostname remains
                  the same (meaning it still remains the same hostname
                  as it is in my image that the respective template
                  uses).<br>
                  <br>
                  I'm using openSUSE 11.4 and OpenNebula 3.2.0.<br>
                  <br>
                  What are the other ways to try to set the hostname in
                  my VM's? Since more VM's will use the same image, I
                  cannot simply set it in my image. Is anything need to
                  be done regarding the hostname in the respective
                  image?<br>
                  <br>
                  Thanks, <br>
                  Lehel.<br>
                  <br>
                </td>
              </tr>
            </tbody>
          </table>
          <br>
          _______________________________________________<br>
          Users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org"
            target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Olivier Sallou
IRISA / University of Rennes 1
Campus de Beaulieu, 35000 RENNES - FRANCE
Tel: 02.99.84.71.95

gpg key id: 4096R/326D8438  (keyring.debian.org)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335  D26D 78DC 68DB 326D 8438

</pre>
  </body>
</html>