Hi,

On Fri, Jan 2, 2015 at 9:41 PM, Steven Timm <[email protected]> wrote:

> The following syntax works in the CONTEXT section.
>
>  TESTUSER="$UNAME",
>
> The following syntax does not work in the CONTEXT section
>
>  TESTTEMPLATEUSER="$USER[NAME]"
>
> (It doesn't throw an error, it just doesn't do anything..the
> variable doesn't show up at all).
>
> What I really wanted to for easy compatibility is to
> replace
>
> $CTX_USER="$USER[TEMPLATE]"
> (which puts the full user template, base-64 encoded into the context.sh
> script)
>
> with
> $CTX_USER="$USER[NAME]"
>
> Which I hoped would have given me a shortened base-64 encoded
> string with just the stuff I wanted.
>
> But it looks to me that the only fields that are allowed in
> this syntax are not the standard fields but only
> the things that are supplied in the "USER TEMPLATE" section
> of the XML.  Is that correct?


That's correct, only attributes inside the USER/TEMPLATE element can be
injected.

Best regards.
--
Carlos Martín, MSc
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | [email protected] | @OpenNebula
<http://twitter.com/opennebula> <[email protected]>

On Fri, Jan 2, 2015 at 9:41 PM, Steven Timm <[email protected]> wrote:

> The following syntax works in the CONTEXT section.
>
>  TESTUSER="$UNAME",
>
> The following syntax does not work in the CONTEXT section
>
>  TESTTEMPLATEUSER="$USER[NAME]"
>
> (It doesn't throw an error, it just doesn't do anything..the
> variable doesn't show up at all).
>
> What I really wanted to for easy compatibility is to
> replace
>
> $CTX_USER="$USER[TEMPLATE]"
> (which puts the full user template, base-64 encoded into the context.sh
> script)
>
> with
> $CTX_USER="$USER[NAME]"
>
> Which I hoped would have given me a shortened base-64 encoded
> string with just the stuff I wanted.
>
> But it looks to me that the only fields that are allowed in
> this syntax are not the standard fields but only
> the things that are supplied in the "USER TEMPLATE" section
> of the XML.  Is that correct?
>
> I can get what I need via the pre-defined UNAME variable but
> it will take some changing of my script.
>
> Thanks for any help you can provide.
>
> Steve Timm
>
>
>
>
>
>
> On Mon, 17 Nov 2014, Carlos Martín Sánchez wrote:
>
>  Hi,
>> You can use $UNAME for the username, or $USER[ATTR] for an individual
>> attribute of the user template [1].
>>
>> Best regards
>>
>> [1] http://docs.opennebula.org/4.10/user/virtual_machine_setup/cong.html
>>
>> --
>> Carlos Martín, MSc
>> Project Engineer
>> OpenNebula - Flexible Enterprise Cloud Made Simple
>> www.OpenNebula.org | [email protected] | @OpenNebula
>>
>> On Thu, Nov 13, 2014 at 4:34 PM, Steven Timm <[email protected]> wrote:
>>       Under OpenNebula 3.2 we would include in the
>>       contextualization section the field $USER[TEMPLATE]
>>       and then add a contextualization script such that
>>       we would grab the field /USER/NAME out of the base64 encoded
>>       template information.
>>
>>       In Opennebula 4.8 you can still put $USER[TEMPLATE]
>>       into your contextualization but now there is a lot more junk
>>       in $USER[TEMPLATE], namely all the key pairs that have been
>>       created via ec2CreateKeyPair for each user.  At first we
>>       did not know what was happening because $USER[TEMPLATE]
>>       grew to over 300kb, a size that actually breaks bash! (you can't
>>       assign a shell variable to a value that big).
>>
>>       So now the question is--is there a way to include only the
>>       user name field of the template in the contextualization
>>       section,
>>       and nothing else, through some combination of ruby syntax.
>>       If so, how?
>>
>>       Steve Timm
>>
>>
>>       ------------------------------------------------------------------
>>       Steven C. Timm, Ph.D  (630) 840-8525
>>       [email protected]  http://home.fnal.gov/~timm/
>>       Office:  Wilson Hall room 804
>>       Fermilab Scientific Computing Division,
>>       Currently transitioning from:
>>       Scientific Computing Services Quadrant
>>       Grid and Cloud Services Dept., Associate Dept. Head for Cloud
>>       Computing
>>
>>       To:
>>       Scientific Computing Facilities Quadrant.,
>>       Experimental Computing Facilities Dept.,
>>       Project Lead for Virtual Facility Project.
>>
>>
>>       _______________________________________________
>>       Users mailing list
>>       [email protected]
>>       http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>>
>>
>>
>>
> ------------------------------------------------------------------
> Steven C. Timm, Ph.D  (630) 840-8525
> [email protected]  http://home.fnal.gov/~timm/
> Office:  Wilson Hall room 804
> Fermilab Scientific Computing Division,
> Scientific Computing Facilities Quadrant.,
> Experimental Computing Facilities Dept.,
> Project Lead for Virtual Facility Project.
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to