<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 11/26/2013 11:14 AM, Carlos Martín
      Sánchez wrote:<br>
    </div>
    <blockquote
cite="mid:CAEPYvFKM5Zkv1u5nro=ZV4T4A9L7246BwaSZ-R-rksjzmFp_kA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>When the VM is created, the template contents are parsed
          and stored in VM/TEMPLATE. All the extra unknown attributes
          are stored in VM/USER_TEMPLATE. You can see this with the
          onevm show -x command. The onevm update action only allows to
          edit the USER_TEMPLATE attributes, and as you described, the
          create hook is triggered after the VM has been correctly
          created.</div>
        <div><br>
        </div>
        <div>I don't see any easy way to make your work flow fit into
          OpenNebula. Could you elaborate a bit more on your use case?</div>
      </div>
    </blockquote>
    What I expect is to get my USER_TEMPLATE in the context.sh mounted
    in my VM.<br>
    <br>
    A basic use case is to generate a unique password for a web
    application running in the VM. I'd like to generate the passsword
    with a hook and send the password to the user by mail (until here,
    this is fine). The generated password is also in the VM
    context/template so that it appears in the context.sh of the VM. At
    startup, a specific init script read the VM contextualization and
    init the web application with the password provided.<br>
    <br>
    <br>
    Olivier<br>
    <blockquote
cite="mid:CAEPYvFKM5Zkv1u5nro=ZV4T4A9L7246BwaSZ-R-rksjzmFp_kA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>I'm assuming you want those two variables to end in the
          context section of the VM. In that case the preferred way to
          do so would be to have a VM Template for each Image, and in
          there set the needed variables.</div>
        <div><br>
        </div>
        <div>Regards</div>
        <div>--<br>
        </div>
        <div class="gmail_extra">
          <div>
            <div dir="ltr">
              <div>Carlos Martín, MSc<br>
                Project Engineer</div>
              <div>OpenNebula - Flexible Enterprise Cloud Made Simple<br>
                <div><span
style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a
                      moz-do-not-send="true"
                      href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a>
                    | <a moz-do-not-send="true"
                      href="mailto:cmartin@opennebula.org"
                      target="_blank">cmartin@opennebula.org</a> | <a
                      moz-do-not-send="true"
                      href="http://twitter.com/opennebula"
                      target="_blank">@OpenNebula</a></span><span
style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"></span></div>
              </div>
            </div>
          </div>
          <br>
          <br>
          <div class="gmail_quote">On Tue, Nov 26, 2013 at 8:41 AM,
            Olivier Sallou <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:olivier.sallou@irisa.fr" target="_blank">olivier.sallou@irisa.fr</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"> Hi,<br>
                <br>
                <div>If my VM HOOK (on CREATE) adds new elements with a
                  onevm update, I can see those variables in the the
                  "user template"  of the vm/<br>
                </div>
                <br>
                onevm show:<br>
                <br>
                ....<br>
                USER
                TEMPLATE                                                                  

                <br>
                SSH_PUBLIC_KEY="ssh-rsa......"<br>
                XGRID_PWD="xxx"<br>
                ....<br>
                <br>
                In my image template, I have set:<br>
                <br>
                <table
                  style="background-image:none!important;background-color:rgb(253,253,253);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin:0px
                  0px
                  18px;border:0px!important;border-collapse:collapse;border-spacing:0px;color:rgb(34,34,34);font-family:'Open
                  Sans',sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:28px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;width:776px;background-repeat:initial
                  initial!important">
                  <tbody>
                    <tr
                      style="border:0px!important;background-color:rgb(249,249,249);background-repeat:initial
                      initial">
                      <td style="margin:0px;padding:1px 10px 1px
35px;font-size:14px;direction:ltr;text-align:left;display:table-cell;line-height:18px;color:rgb(51,51,51);vertical-align:top;border-top-style:none;border-right-style:none;border-left-style:none;border-bottom-width:0px;font-weight:normal">SSH_PUBLIC_KEY</td>
                      <td style="margin:0px;padding:1px
10px;font-size:14px;direction:ltr;text-align:left;display:table-cell;line-height:18px;color:rgb(51,51,51);vertical-align:top;border-top-style:none;border-right-style:none;border-left-style:none;border-bottom-width:0px;text-overflow:ellipsis;word-break:break-all">$USER[SSH_PUBLIC_KEY]</td>
                    </tr>
                    <tr
                      style="border:0px!important;background-image:none!important;background-repeat:initial
                      initial!important">
                      <td style="margin:0px;padding:1px 10px 1px
35px;font-size:14px;direction:ltr;text-align:left;display:table-cell;line-height:18px;color:rgb(51,51,51);vertical-align:top;border-top-style:none;border-right-style:none;border-left-style:none;border-bottom-width:0px;font-weight:normal">XGRID_PWD</td>
                      <td style="margin:0px;padding:1px
10px;font-size:14px;direction:ltr;text-align:left;display:table-cell;line-height:18px;color:rgb(51,51,51);vertical-align:top;border-top-style:none;border-right-style:none;border-left-style:none;border-bottom-width:0px;text-overflow:ellipsis;word-break:break-all">$USER[XGRID_PWD]</td>
                    </tr>
                  </tbody>
                </table>
                <br>
                But in the VM template, I do not see any of those
                variable.<br>
                <br>
                It would seem that user template attributes are created
                *after* the vm template generation.<br>
                <br>
                Any idea  ?<br>
                <br>
                Thanks<span class="HOEnZb"><font color="#888888"><br>
                    <br>
                    Olivier<br>
                    <br>
                    <br>
                  </font></span></div>
              <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>
        </div>
      </div>
    </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>