Use variables in hooks


To further simplify my deployment, I want to write a script that generates a record based on the IP address and the host name (specified as a variable during setup) of a VM and sends it to the API of my nameservers.

The script should be executed during the initial deployment and after the VM has been deleted.
Now I have discovered the OpenNebula hooks, but can I also use the variables of a VM like the IP address or a variable which I have self defined during contextualization?



Besides the VM Template that is provided to the hook you could also query OpenNebula for info about the VM via the API or the onevm tool.

Anton Todorov