Hi,<div><br></div><div>The feature request #1026 [1] can be easily implemented with hooks [2].</div><div><br></div><div>For instance, with these two hooks you don't even need any script file:</div><div><br></div><div><div>
<font face="'courier new', monospace">VM_HOOK = [</font></div><div><font face="'courier new', monospace"> name = "vmdir_cleanup",</font></div><div><font face="'courier new', monospace"> on = "DONE",</font></div>
<div><font face="'courier new', monospace"> command = "/bin/rm",</font></div><div><font face="'courier new', monospace"> arguments = "-r /var/lib/one/$VMID" ]</font></div><div><font face="'courier new', monospace"> </font></div>
<div><font face="'courier new', monospace">VM_HOOK = [</font></div><div><font face="'courier new', monospace"> name = "log_cleanup",</font></div><div><font face="'courier new', monospace"> on = "DONE",</font></div>
<div><font face="'courier new', monospace"> command = "/bin/rm",</font></div><div><font face="'courier new', monospace"> arguments = "/var/log/one/$VMID.log" ]</font></div></div>
<div>
<br></div><div><br></div><div>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.</div><div><br></div><div>That means that this hook won't be triggered:</div>
<div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">VM_HOOK = [</font></div><div><font face="'courier new', monospace"> name = "cleanup",</font></div>
<div><font face="'courier new', monospace"> on = "DONE",</font></div><div><font face="'courier new', monospace"> command = "cleanup.sh",</font></div><div><font face="'courier new', monospace"> arguments = "$VMID" ]</font></div>
</div><div><br></div><div><br></div><div>And you must use this one instead:</div><div><br></div><div><div><font face="'courier new', monospace">VM_HOOK = [</font></div><div><font face="'courier new', monospace"> name = "cleanup",</font></div>
<div><font face="'courier new', monospace"> on = "DONE",</font></div><div><font face="'courier new', monospace"> command = "/full/path/to/cleanup.sh",</font></div><div><font face="'courier new', monospace"> arguments = "$VMID" ]</font></div>
</div><div><br></div><div>Cheers.</div><div><br></div><div>[1] <a href="http://dev.opennebula.org/issues/1026" target="_blank">http://dev.opennebula.org/issues/1026</a></div>
<div>[2] <a href="http://opennebula.org/documentation:rel3.0:hooks" target="_blank">http://opennebula.org/documentation:rel3.0:hooks</a></div><div>[3] <a href="http://dev.opennebula.org/issues/1036">http://dev.opennebula.org/issues/1036</a><br clear="all">
<span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px">--<br>
Carlos Martín, MSc<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Data Center Virtualization<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span><br>
<br><br><div class="gmail_quote">On Fri, Dec 16, 2011 at 9:44 AM, richard -rw- weinberger <span dir="ltr"><<a href="mailto:richard.weinberger@gmail.com" target="_blank">richard.weinberger@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Fri, Dec 16, 2011 at 1:02 AM, Hutson Betts <<a href="mailto:hut101@tamu.edu" target="_blank">hut101@tamu.edu</a>> wrote:<br>
> This is not necessarily an answer to your question, but if you'll<br>
> consider taking a look at Feature #1026 that I created on the dev site.<br>
<br>
</div>#1026 is exactly what I want. :-)<br>
<div><div><br>
--<br>
Thanks,<br>
//richard<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
</div></div></blockquote></div><br></div>