[one-users] Removing old VMs

Carlos Martín Sánchez cmartin at opennebula.org
Tue Dec 20 05:56:14 PST 2011


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 | cmartin at opennebula.org |
@OpenNebula<http://twitter.com/opennebula><cmartin at opennebula.org>


On Fri, Dec 16, 2011 at 9:44 AM, richard -rw- weinberger <
richard.weinberger at gmail.com> wrote:

> On Fri, Dec 16, 2011 at 1:02 AM, Hutson Betts <hut101 at tamu.edu> 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
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20111220/9207441b/attachment-0003.htm>


More information about the Users mailing list