Hi, On Fri, May 2, 2014 at 5:09 PM, Thomas Stein <[email protected]> wrote:
> Hello. > > I need a litte bit help with the hook system. I think i'm having > problems understanding the concept. Let's say i wanna have a script > executed after a start of a certain VM. How would the hook look like? > Something like this? > > VM_HOOK = [ > name = "change_gateway", > on = "START", > state = "ACTIVE", > command = "cg.sh", > arguments = "$ID" ] > No, on START is not a valid option, see [1] for a reference. It should look like: VM_HOOK = [ name = "change_gateway", on = "RUNNING", # or CREATE command = "cg.sh", arguments = "$ID" ] > So this goes to /etc/one/oned.conf? Yes. If you don't use an absolute path for the command, it needs to be copied into /var/lib/one/remotes/hooks > Do i need to assign this to the VM > in some way? > Hooks are triggered for all VMs, you don't need to enable the hook in any way. > $ID = ID of the VM? > Yes, OpenNebula will call your command with the arguments provided. $ID will be replaced with the VM ID. > Sorry a lot of questions. Thanks and best regards > > t. > Regards [1] http://docs.opennebula.org/4.6/integration/infrastructure_integration/hooks.html -- Carlos Martín, MSc Project Engineer OpenNebula - Flexible Enterprise Cloud Made Simple www.OpenNebula.org <http://www.opennebula.org/> | [email protected] | @OpenNebula <http://twitter.com/opennebula>
_______________________________________________ Users mailing list [email protected] http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
