[one-users] hooks execution on remote nodes without shared ONE installation dir
knawnd at gmail.com
knawnd at gmail.com
Tue Aug 30 05:11:37 PDT 2011
Hi Tino,
Tino Vazquez wrote on 29/08/11 17:17:
> Hi Nikolay,
>
> Ok, if not on system-wide, please copy them to
> $ONE_LOCATION/var/remotes, and see how it goes.
A hook script copied into $ONE_LOCATION/var/remotes on front-end node
appears on CNs in $SCRIPTS_REMOTE_DIR. But it's written the following in
[1] and oned.conf (in "Hook Manager Configuration"):
# Virtual Machine Hooks (VM_HOOK) defined by:
[...snip...]
# command : path can be absolute or relative to
$ONE_LOCATION/share/hooks
# case of self-contained installation or relative to
# /usr/share/one/hooks in case of system-wide installation
The above is true only for local hooks (i.e. hooks executed on front-end
node).
If a hook has to be executed on remote node (remote="yes") then a path
has to correspond to the hook script location on CN and thus the
citation above is almost never true (it's true only if admin creates
exactly the same directory structure for $ONE_LOCATION/share/hooks in
case of self-contained installation or /usr/share/one/hooks in case of
system-wide installation and puts there the hook script).
I think that has to be explicitly mentioned in [1] and oned.conf.
By the way, it's not possible to use $SCRIPTS_REMOTE_DIR variable when
defining a path for remote hook like
VM_HOOK = [
name = "vzfirewall",
on = "RUNNING",
command = "$SCRIPTS_REMOTE_DIR/hooks/vzfirewall.sh",
arguments = "",
remote = "yes" ]
since an argument for command parameter is translated into
$ONE_LOCATION/$SCRIPTS_REMOTE_DIR/hooks/vzfirewall.sh. The value of
$SCRIPTS_REMOTE_DIR is unknown for hook manager (?) and/or cluster
node(?) (so it's empty). The hook manager is trying to execute
$ONE_LOCATION//hooks/vzfirewall.sh and fails.
So admin has to specify the value of $SCRIPTS_REMOTE_DIR twice in
oned.conf: the first time when defining the variable itself and the
second one - for specifying a absolute path of the remote hook on CN. It
would be more convenient if admin have a possibility to refer to
$SCRIPTS_REMOTE_DIR variable defining remote hooks path.
[1] http://opennebula.org/documentation:rel2.2:hooks
Thanks for helping me with understanding that issue!
Hopefully my feedback is also useful.
Nikolay.
>
> Regards,
>
> -Tino
>
> --
> Constantino Vázquez Blanco, MSc
> OpenNebula Major Contributor
> www.OpenNebula.org | @tinova79
>
>
>
> On Mon, Aug 29, 2011 at 9:19 AM,<knawnd at gmail.com> wrote:
>> any news/help on that?
>>
>> Nikolay.
>>
>> knawnd at gmail.com wrote on 23/08/11 15:16:
>>>
>>> Tino Vazquez wrote on 23/08/11 14:45:
>>>>
>>>> Hi,
>>>>
>>>> Let's try this, since this seems like a bug. Could you please copy the
>>>> hook into "/var/lib/one/remotes" and "onehost sync" again?
>>>
>>> Since in my deployment scenario OpenNebula is installed in
>>> self-contained mode there was no such dir as /var/lib/one/. So I created
>>> it:
>>> [root at FN]$ mkdir -p /var/lib/one/remotes
>>> [root at FN]$ chown oneadmin:cloud -R /var/lib/one/
>>>
>>> And then
>>> [oneadmin at FN]$ cp $ONE_LOCATOIN/share/hooks/* /var/lib/one/remotes/
>>>
>>> [oneadmin at FN]$ ll /var/lib/one/remotes/
>>> total 28
>>> -rwxr-xr-x 1 oneadmin cloud 3589 Aug 23 15:59 ebtables-flush
>>> -rwxr-xr-x 1 oneadmin cloud 3529 Aug 23 15:59 ebtables-kvm
>>> -rwxr-xr-x 1 oneadmin cloud 3459 Aug 23 15:59 ebtables-xen
>>> -rwxr-xr-x 1 oneadmin cloud 3084 Aug 23 15:59 host_error.rb
>>> -rwxr-xr-x 1 oneadmin cloud 2408 Aug 23 15:59 image.rb
>>> -rwxr-xr-x 1 oneadmin cloud 2151 Aug 23 15:59 image.rb.bk
>>> -rwxr-xr-x 1 oneadmin cloud 42 Aug 23 15:59 vzfirewall.sh
>>>
>>> [oneadmin at FN]$ onehost sync
>>>
>>> During next monitoring cycle the driver scripts had been updated on CNs
>>> (i.e. the content of /tmp/one/im/ovz/ and /tmp/one/vmm/ovz/ dirs) but no
>>> hooks scripts appeared in /tmp/one on CNs (checked by running 'find
>>> /tmp/one/ -name vzfirewall.sh').
>>>
>>> So it looks like hooks scripts were not copied even from
>>> /var/lib/one/remotes.
>>> More ideas?
>>>
>>> Thanks!
>>> Nikolay.
>>>
>>>>
>>>> Regards,
>>>>
>>>> -Tino
>>
More information about the Users
mailing list