Hi, <br><br>The mechanism you are referring to is the 'onehost sync', it has to be executed as oneadmin in the front-end.<br>This will force the hooks and drivers scripts to be copied to the hosts in the next monitorization cycle.<br>
<br>Regards.<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 Major Contributor<br><span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span> - The Open Source Toolkit for Cloud Computing<br>
<a href="http://www.opennebula.org/" style="color:rgb(42, 93, 176)" target="_blank">www.<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span>.org</a> | <a href="mailto:cmartin@opennebula.org" style="color:rgb(42, 93, 176)" target="_blank">cmartin@<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">opennebula</span>.org</a></span><br>
<br><br><div class="gmail_quote">On Thu, Aug 4, 2011 at 10:55 AM, <span dir="ltr"><<a href="mailto:knawnd@gmail.com">knawnd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
forgot to mention that I could not find any info in [1] too about a necessity to share $ONE_LOCATION/share/hooks dir across CNs in case if hooks has to be executed on remote node. So I wonder if $ONE_LOCATION/share/hooks needs to be available across CNs if there is hook to be executed on CNs or there is some built-in mechanism in ONE which transfers such hooks to CNs but for some reasons it didn't work in my case?<br>
<br>
Regards,<br>
Nikolay<br>
<br>
[1] <a href="http://opennebula.org/documentation:rel2.2:hooks" target="_blank">http://opennebula.org/<u></u>documentation:rel2.2:hooks</a><br>
<br>
<br>
<a href="mailto:knawnd@gmail.com" target="_blank">knawnd@gmail.com</a> wrote on 03/08/11 11:33:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<br>
<br>
I am trying to run some custom hook on remote/cluster node.<br>
I defined the hook as below:<br>
oned.conf:<br>
VM_HOOK = [<br>
name = "vzfirewall",<br>
on = "RUNNING",<br>
command = "vzfirewall.sh",<br>
arguments = "",<br>
remote = "yes" ]<br>
<br>
and create the vzfirewall.sh file:<br>
$ ll $ONE_LOCATION/share/hooks/<u></u>vzfirewall.sh<br>
-rwxr-xr-x 1 oneadmin cloud 42 Aug 1 22:00<br>
/srv/cloud/one/one-2.2.1/<u></u>share/hooks/vzfirewall.sh<br>
<br>
with the following content:<br>
[FN]$ cat $ONE_LOCATION/share/hooks/<u></u>vzfirewall.sh<br>
#!/bin/bash<br>
<br>
sudo /usr/sbin/vzfirewall -a<br>
<br>
So that hook has to invoke /usr/sbin/vzfirewall script located on all CNs.<br>
<br>
[CNs]$ ll /usr/sbin/vzfirewall<br>
-rwxr-xr-x 1 root root 7661 Jun 4 13:36 /usr/sbin/vzfirewall<br>
<br>
After defining that hook in oned.conf the oned had been restarted and in<br>
oned.log the relevant line appeared:<br>
[...]<br>
VM_HOOK=ARGUMENTS="",COMMAND=<u></u>vzfirewall.sh,NAME=vzfirewall,<u></u>ON=RUNNING,REMOTE=yes<br>
<br>
[...]<br>
<br>
But when VM reaches the RUNNING state on CN, the following errors appear<br>
in the oned.log:<br>
[...]<br>
Wed Aug 3 12:27:35 2011 [VMM][D]: Message received: DEPLOY SUCCESS 28 128<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 Command<br>
execution fail: '/srv/cloud/one/one-2.2.1/<u></u>share/hooks/vzfirewall.sh ""'<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 STDERR<br>
follows.<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 Warning:<br>
Permanently added '<CN_hostname>,<CN_IP-address><u></u>' (RSA) to the list of<br>
known hosts.<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 bash:<br>
/srv/cloud/one/one-2.2.1/<u></u>share/hooks/vzfirewall.sh: No such file or<br>
directory<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 ExitCode: 127<br>
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: EXECUTE FAILURE 28<br>
vzfirewall<br>
[...]<br>
<br>
So I wonder if $ONE_LOCATION/share/hooks/ dir must be mounted on CNs in<br>
case if hook needs to be executed there (i.e. on remote node)?<br>
<br>
I didn't find corresponding info neither in [1] nor in [2].<br>
<br>
[1] <a href="http://opennebula.org/documentation:rel2.2:sm" target="_blank">http://opennebula.org/<u></u>documentation:rel2.2:sm</a><br>
[2] <a href="http://opennebula.org/documentation:rel2.2:plan" target="_blank">http://opennebula.org/<u></u>documentation:rel2.2:plan</a><br>
<br>
Regards,<br>
Nikolay.<br>
</blockquote>
______________________________<u></u>_________________<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/<u></u>listinfo.cgi/users-opennebula.<u></u>org</a><br>
</div></div></blockquote></div><br>