[one-users] hooks execution on remote nodes without shared ONE installation dir
Carlos Martín Sánchez
cmartin at opennebula.org
Thu Aug 11 02:55:54 PDT 2011
Hi,
The mechanism you are referring to is the 'onehost sync', it has to be
executed as oneadmin in the front-end.
This will force the hooks and drivers scripts to be copied to the hosts in
the next monitorization cycle.
Regards.
--
Carlos Martín, MSc
Project Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org <http://www.opennebula.org/> | cmartin at opennebula.org
On Thu, Aug 4, 2011 at 10:55 AM, <knawnd at gmail.com> wrote:
> 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<http://opennebula.org/documentation:rel2.2:hooks>
>
>
> knawnd at 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<http://opennebula.org/documentation:rel2.2:sm>
>> [2] http://opennebula.org/**documentation:rel2.2:plan<http://opennebula.org/documentation:rel2.2:plan>
>>
>> Regards,
>> Nikolay.
>>
> ______________________________**_________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/**listinfo.cgi/users-opennebula.**org<http://lists.opennebula.org/listinfo.cgi/users-opennebula.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110811/3a3780c7/attachment-0003.htm>
More information about the Users
mailing list