Hi,

The feature request #1026 [1] can be easily implemented with hooks [2].

For instance, with these two hooks you don't even need any script file:

VM_HOOK = [
   name      = "vmdir_cleanup",
   on        = "DONE",
   command   = "/bin/rm",
   arguments = "-r /var/lib/one/$VMID" ]

VM_HOOK = [
   name      = "log_cleanup",
   on        = "DONE",
   command   = "/bin/rm",
   arguments = "/var/log/one/$VMID.log" ]


If you want to create an external script, please take into account bug
#1036: Local hooks are not executed unless the full path is defined.

That means that this hook won't be triggered:

VM_HOOK = [
   name      = "cleanup",
   on        = "DONE",
   command   = "cleanup.sh",
   arguments = "$VMID" ]


And you must use this one instead:

VM_HOOK = [
   name      = "cleanup",
   on        = "DONE",
   command   = "/full/path/to/cleanup.sh",
   arguments = "$VMID" ]

Cheers.

[1] http://dev.opennebula.org/issues/1026
[2] http://opennebula.org/documentation:rel3.0:hooks
[3] http://dev.opennebula.org/issues/1036
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | [email protected] |
@OpenNebula<http://twitter.com/opennebula><[email protected]>


On Fri, Dec 16, 2011 at 9:44 AM, richard -rw- weinberger <
[email protected]> wrote:

> On Fri, Dec 16, 2011 at 1:02 AM, Hutson Betts <[email protected]> wrote:
> > This is not necessarily an answer to your question, but if you'll
> > consider taking a look at Feature #1026 that I created on the dev site.
>
> #1026 is exactly what I want. :-)
>
> --
> Thanks,
> //richard
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to