[one-users] VM_HOOK "on = CREATE" cannot work on remote hosts

Akihiko Ota skywalker.37th at gmail.com
Sun Jun 17 23:34:26 PDT 2012


Hi,

I tryed to run a script on remote hosts by VM_HOOK. It works as
intended if it is defined "on = DONE", but don't work if defined "on = CREATE".
I have defined a hook in etc/oned.conf as follows:

VM_HOOK = [
   name      = "clear_work",
   on        = "CREATE",
   command   = "ft/clear_work.sh",
   remote    = "YES",
   arguments = "" ]

Then deployed the script to remote VM hosting machines by "onehost sync",
and restart oned. But the HOOK had failed.

Mon Jun 18 14:30:08 2012 [HKM][D]: Message received: LOG I 166 Command
execution fail: /var/tmp/one/hooks//ft/clear_work.sh ""
Mon Jun 18 14:30:08 2012 [HKM][D]: Message received: LOG I 166 sh:
/var/tmp/one/hooks//ft/clear_work.sh: No such file or directory
Mon Jun 18 14:30:08 2012 [HKM][D]: Message received: LOG I 166 ExitCode: 127
Mon Jun 18 14:30:08 2012 [HKM][D]: Message received: EXECUTE FAILURE
166 clear_work: -

"/var/tmp/one/hooks//ft/clear_work.sh" script exists on all VM hosting
machines. So, I had a try deploy a dummy script onto the OpenNebula
frontend machine:

[ascadm at frontend]% /bin/hostname
frontend
[ascadm at frontend]% mkdir -p /var/tmp/one/hooks//ft/
[ascadm at frontend]% cat > /var/tmp/one/hooks//ft/clear_work.sh
#!/bin/sh
/bin/hostname
^D
[ascadm at frontend]% chmod +x /var/tmp/one/hooks//ft/clear_work.sh
[ascadm at frontend]% onevm create ~/work/vms/normal.one
ID: 167

[ascadm at frontend]% less /srv/cloud/one/var/oned.log
(snip)
Mon Jun 18 14:40:58 2012 [HKM][D]: Message received: LOG I 167 ExitCode: 0
Mon Jun 18 14:40:58 2012 [HKM][D]: Message received: EXECUTE SUCCESS
167 clear_work: frontend
(snip)

It seems HOOK script runs on the frontend machine instead of the
remote host. Is this correct behavior?

I am using OpenNebula 3.2.1 on CentOS 5.7(x86_64) now.

Thanks,

-- 
Akihiko Ota



More information about the Users mailing list