Hi, Thanks for the information, I will try that in my init.sh.. Thanks, Hyunwoo FermiCloud Project On Aug 30, 2012, at 4:10 AM, Nicolas AGIUS wrote:
> Hi > > With this method, you have to add a NAME variable in every user template, > which could become quickly boring. > > I've done this in a more reliable way, and without patching or doing manual > template modification, using the full xml template. > > Example, in the context definiton : > > CONTEXT=[ > FILES=init.sh, > CTX_USER="$USER[TEMPLATE]" > ] > > And within the vm, in the init.sh script : > > #!/bin/bash > source context.sh > username=$(echo $CTX_USER | base64 -d | xpath -e '/USER/NAME/text()' ) > > > Cheers, > Nicolas AGIUS > > --- En date de : Mar 28.8.12, Hyun Woo Kim <hyun...@fnal.gov> a écrit : > > De: Hyun Woo Kim <hyun...@fnal.gov> > Objet: Re: [one-users] Context variables - getting username > À: "Jon Burger" <jpbur...@gmail.com> > Cc: "<users@lists.opennebula.org>" <users@lists.opennebula.org> > Date: Mardi 28 août 2012, 17h04 > > Hi, > > Yesterday I learned from ON developer Ruben that > for instance oneadmin can do > oneuser update ID(of the user who actually instantiates the VM template) > which will open an editor where oneadmin can type in > NAME="the username you want". > This will enable $USER[NAME] to return "the username you want" in the CONTEXT. > > Hope this helps. > Hyunwoo > > > On Aug 27, 2012, at 6:42 PM, Jon Burger wrote: > > > Hello, > > > > I would like to know if there is a context variable that contains the > > username of the person creating the VM. We have OpenNebula authenticating > > against active directory and wish to pass the username into the VM to > > create the user id locally (in the case of Linux use kerberose). > > > > I understand I can get UserID eg $UID, and that by using $USER[TEMPLATE] > > can receive a 64bit encoded XML string that contains the username, but I'd > > rather not parse XML if I can help it as that feels a little dirty to me. > > > > We have tried the obvious $USER[NAME] - which always returns null. > > > > It may just be a bug, but before submitting I thought I would ask. > > > > Thanks, > > > > Jon > > _______________________________________________ > > Users mailing list > > Users@lists.opennebula.org > > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org > > > -----La pièce jointe associée suit----- > > _______________________________________________ > Users mailing list > Users@lists.opennebula.org > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org