[one-users] hooks execution on remote nodes without shared ONE installation dir

knawnd at gmail.com knawnd at gmail.com
Wed Aug 3 01:33:15 PDT 2011


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.



More information about the Users mailing list