[one-users] Fwd: Template parameters arguments to hook script?

Gary S. Cuozzo gary at isgsoftware.net
Thu Aug 16 08:20:08 PDT 2012


Hi,
I believe the $TEMPLATE is actually a base64 encoded version of the entire XML document with all the variable in it.  That is how the DS/TM stuff works.  If you look in any of the DS or TM scripts, you can copy/paste the xpath related lines to access any variables you want.

If you want to see the exact structure, you can get the base64 encoded stream from the oned.log and run it through the base64 command to see the xml which is encoded.

Something like:  echo "encoded stream here" | base64

Hope that helps.  I have not used hooks, but I have used this to develop custom DS/TM drivers.
gary


----- Original Message -----
From: "reeuwijk" <reeuwijk at few.vu.nl>
To: "opennebula users" <users at lists.opennebula.org>
Sent: Thursday, August 16, 2012 10:12:54 AM
Subject: [one-users] Fwd: Template parameters arguments to hook script?

Hi,

I want to pass some parameters from OpenNebula templates to a hook script.

In OpenNebula 2.2 I could use something like 

CONTEXT = [ 
:
   SERVER = "bla"
:
]

and then in oned.conf I could use a hook script with something like:

VM_HOOK = [
   arguments = " … $CONTEXT[SERVER] …"
]

and the hook script would be invoked with the value I defined in CONTEXT.

Unfortunately, it seems that OpenNebula 3.6 does not support this any longer. Instead of the value defined in CONTEXT, the expression '$CONTEXT' is replaced with the empty string, so the hook script of the example always gets the string [SERVER].

>From the documentation it is not entirely clear to me whether the mechanism I used for 2.2 is supported at all. The webpage at http://opennebula.org/documentation:rel3.6:oned_conf only mentions access to $VMID and $TEMPLATE and nothing else, so I may have been using an undocumented feature of OpenNebula 2.2.

However, limiting access to only those two variables seems overly restrictive to me, so for now I am assuming more is possible. But exactly what is allowed, and what is not?

-- 
Kees van Reeuwijk



_______________________________________________
Users mailing list
Users at lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



More information about the Users mailing list