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?

Regards,
Nikolay

[1] http://opennebula.org/documentation:rel2.2:hooks


kna...@gmail.com wrote on 03/08/11 11:33:
Hi!

I am trying to run some custom hook on remote/cluster node.
I defined the hook as below:
oned.conf:
VM_HOOK = [
name = "vzfirewall",
on = "RUNNING",
command = "vzfirewall.sh",
arguments = "",
remote = "yes" ]

and create the vzfirewall.sh file:
$ ll $ONE_LOCATION/share/hooks/vzfirewall.sh
-rwxr-xr-x 1 oneadmin cloud 42 Aug 1 22:00
/srv/cloud/one/one-2.2.1/share/hooks/vzfirewall.sh

with the following content:
[FN]$ cat $ONE_LOCATION/share/hooks/vzfirewall.sh
#!/bin/bash

sudo /usr/sbin/vzfirewall -a

So that hook has to invoke /usr/sbin/vzfirewall script located on all CNs.

[CNs]$ ll /usr/sbin/vzfirewall
-rwxr-xr-x 1 root root 7661 Jun 4 13:36 /usr/sbin/vzfirewall

After defining that hook in oned.conf the oned had been restarted and in
oned.log the relevant line appeared:
[...]
VM_HOOK=ARGUMENTS="",COMMAND=vzfirewall.sh,NAME=vzfirewall,ON=RUNNING,REMOTE=yes

[...]

But when VM reaches the RUNNING state on CN, the following errors appear
in the oned.log:
[...]
Wed Aug 3 12:27:35 2011 [VMM][D]: Message received: DEPLOY SUCCESS 28 128
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 Command
execution fail: '/srv/cloud/one/one-2.2.1/share/hooks/vzfirewall.sh ""'
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 STDERR
follows.
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 Warning:
Permanently added '<CN_hostname>,<CN_IP-address>' (RSA) to the list of
known hosts.
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 bash:
/srv/cloud/one/one-2.2.1/share/hooks/vzfirewall.sh: No such file or
directory
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: LOG - 28 ExitCode: 127
Wed Aug 3 12:27:36 2011 [HKM][D]: Message received: EXECUTE FAILURE 28
vzfirewall
[...]

So I wonder if $ONE_LOCATION/share/hooks/ dir must be mounted on CNs in
case if hook needs to be executed there (i.e. on remote node)?

I didn't find corresponding info neither in [1] nor in [2].

[1] http://opennebula.org/documentation:rel2.2:sm
[2] http://opennebula.org/documentation:rel2.2:plan

Regards,
Nikolay.
_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to