Hi<div><br></div><div>There is a patch at [1]. You can apply it to OpenNebula3.6, recompile and reinstall or just copy the oned binary.</div><div><br></div><div>Cheers</div><div><br></div><div>Ruben</div><div><br></div><div>

[1] <a href="http://dev.opennebula.org/issues/1428">http://dev.opennebula.org/issues/1428</a><br><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 5:23 AM, Hyun Woo Kim <span dir="ltr"><<a href="mailto:hyunwoo@fnal.gov" target="_blank">hyunwoo@fnal.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Ruben,<br>
<br>
Your answer below about using oneuser update to modify <TEMPLATE/> of user's information<br>
works perfectly for me(us)!!<br>
Thank you very much for your kind and persistent answers.<br>
<br>
Also, please let me know of the patch that you mentioned will be available in a few days.<br>
(about a new variable for user name similar to UID..)<br>
That will be another solution..<br>
<br>
Thanks again.<br>
Hyunwoo<br>
FermiCloud Project<br>
<br>
<br>
<br>
=====================<br>
<div class="im">Question 2.<br>
Are SSH_KEY and TEMPLATE the only two <user_attributes>s available<br>
 for $USER? or is there more? if so, what are they?<br>
why can I not use NAME like<br>
CONTEXT = [<br>
username = $USER[NAME, USER_ID=$VID]<br>
]<br>
<br>
<br>
1.- Templates are free form, you can add anything you want. Please try, in the command line:<br>
<br>
>oneuser update<br>
...<br>
This will open your EDITOR, using the standard syntax you can add any variable, e.g.:<br>
NAME=my_user_name<br>
PASSWORD=mypass<br>
SSH_KEY=AHxa245...<br>
LOGIN=my_login<br>
<br>
Then simply add to the VM template:<br>
<br>
CONTEXT = [<br>
username = $USER[NAME]<br>
login = $USER[LOGIN]<br>
ssh = $USER[SSH_KEY]<br>
]<br>
<br>
2.- You do not need to "qualify" the USER, it will always refer to the user creating the VM. Note that otherwise that will be a security hole, as you could access other user data.<br>
<br>
3.- There are no variables in the user template by default. Note the <TEMPLATE/> element in oneuser show -x, before and after adding template variables with oneuser update.<br>
<br>
</div>________________________________________<br>
From: Ruben S. Montero [<a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a><mailto:<a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a>>]<br>
<div class="im">Sent: Sunday, August 26, 2012 4:33 PM<br>
To: Hyun Woo Kim<br>
</div>Cc: <a href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a><mailto:<a href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a>><br>
<div><div class="h5">Subject: Re: [one-users] Using USER template variable in VM Template<br>
<br>
Hi<br>
<br>
If you look at the output of the XML, -x option, there is something like:<br>
<br>
  <USER><br>
    <ID>6</ID><br>
    <GID>1</GID><br>
    <GNAME>users</GNAME><br>
    <NAME>demo</NAME><br>
    <PASSWORD>89e495e7941cf9e40e6980d14a16bf023ccd4c91</PASSWORD><br>
    <AUTH_DRIVER>core</AUTH_DRIVER><br>
    <ENABLED>1</ENABLED><br>
    <TEMPLATE/><br>
    <DATASTORE_QUOTA/><br>
    <NETWORK_QUOTA/><br>
    <VM_QUOTA/><br>
    <IMAGE_QUOTA/><br>
  </USER><br>
<br>
You can access to anything inside the <TEMPLATE/> element, empty by default.<br>
<br>
There is no direct way to include that information in a VM Template.<br>
This can be done at the API level with some hacking. (Unless you add<br>
NAME to TEMPLATE)<br>
<br>
The original set of pre-defined variables UID, TEMPLATE aren't<br>
obviously up-to-date. I've filled an issue to address this for the<br>
next release [1].<br>
<br>
Thanks<br>
<br>
Ruben<br>
<br>
[1] <a href="http://dev.opennebula.org/issues/1428" target="_blank">http://dev.opennebula.org/issues/1428</a><br>
<br>
</div></div><div class="im">On Sun, Aug 26, 2012 at 11:07 PM, Hyun Woo Kim <<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a><mailto:<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a>>> wrote:<br>
> Hi,<br>
><br>
> Thanks very much for the response.<br>
><br>
> Actually, your answer seems a bit different from what the manual says<br>
> and what I observe.<br>
><br>
> I observe that the "USERS" actually have "TEMPLATE" attribute<br>
> which returns the contents of "user_pool" in the database<br>
> (We are using MySQL).<br>
> The contents of MySQL "user_pool" contain NAME field.<br>
> I thought these fields in DB and <user_attribute>s of USER template<br>
> somehow are related..<br>
><br>
> Let me simplify my original question.<br>
> Is there anyway to fetch the NAME field of the DB for the<br>
> user who does "onetemplate instantiate"..?<br>
><br>
> Thanks,<br>
> Hyunwoo<br>
><br>
><br>
><br>
> Current version of OpenNebula can only access template variables from<br>
> users, or networks. By default users have an empty template, so there<br>
> is no NAME variable unless you define it, e.g. oneuser update. About<br>
> $UID, this variable is predefined so the OpenNebula core it is not<br>
> actually accessing the user information but that stored in the VM.<br>
><br>
> Cheers<br>
><br>
> Ruben<br>
><br>
</div><div><div class="h5">> On Fri, Aug 24, 2012 at 10:37 PM, Hyun Woo Kim <<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a><mailto:<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a>>> wrote:<br>


>> Dear Developers,<br>
>><br>
>> I want to define a variable "username" in CONTEXT<br>
>> and replace it by a real user name who does<br>
>> onetemplate instantiate<br>
>><br>
>> The CONTEXT section of my VM Template looks like the following;<br>
>> CONTEXT = [<br>
>> username    = "$USER[NAME]"<br>
>> ]<br>
>><br>
>> I am following the instruction in<br>
>> <a href="http://opennebula.org/documentation:archives:rel3.2:template" target="_blank">http://opennebula.org/documentation:archives:rel3.2:template</a><br>
>> which says at the bottom ;<br>
>> ...<br>
>> Using User template variables<br>
>> $USER[ <user_attribute> ]: Any single value variable in the user template<br>
>> for example: ssh_key = "$USER[SSH_KEY]"<br>
>> The user_attribute can be TEMPLATE to include…<br>
>> …..<br>
>><br>
>><br>
>> So, I thought NAME can be one possible <user_attribute> like TEMPLATE,<br>
>> but this does not work..<br>
>> I even tried<br>
>> username    = "$USER[NAME, USER_ID=$UID]"<br>
>> username    = "$USER[NAME, ID=$UID]"<br>
>> username    = "$USER[NAME, USER_ID=2]"<br>
>> username    = "$USER[NAME, ID=2]"<br>
>> All fail..<br>
>><br>
>> By the way,<br>
>> username    = "$UID" works and username is assigned my correct user id<br>
>><br>
>> What am I doing wrong here?<br>
>><br>
>><br>
>> Thank you.<br>
>> Hyunwoo<br>
>> _______________________________________________<br>
>> Users mailing list<br>
</div></div>>> <a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><mailto:<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a>><br>
<div class="im">>> <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>
><br>
><br>
><br>
> --<br>
> Ruben S. Montero, PhD<br>
> Project co-Lead and Chief Architect<br>
> OpenNebula - The Open Source Solution for Data Center Virtualization<br>
</div>> <a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a><<a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a>> | <a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a><mailto:<a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a>> | @OpenNebula<br>


<div class="im"><br>
<br>
<br>
--<br>
Ruben S. Montero, PhD<br>
Project co-Lead and Chief Architect<br>
OpenNebula - The Open Source Solution for Data Center Virtualization<br>
</div><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a><<a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a>> | <a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a><mailto:<a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a>> | @OpenNebula<br>


<div class="im"><br>
<br>
<br>
--<br>
Ruben S. Montero, PhD<br>
Project co-Lead and Chief Architect<br>
OpenNebula - The Open Source Solution for Data Center Virtualization<br>
</div><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a><<a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a>> | <a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a><mailto:<a href="mailto:rsmontero@opennebula.org">rsmontero@opennebula.org</a>> | @OpenNebula<br>


</blockquote></div><br><br clear="all"><div><br></div>-- <br>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<br>OpenNebula - The Open Source Solution for Data Center Virtualization<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula<br>


</div>