<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><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 href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a 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"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></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 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 href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a 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>