No hook triggers state "UNKOWN" after host reboots

Hi,

after an host reboots, the VM’s are in state “UNKNOWN”. Now I try to find a VM-Hook, to start my VM’s. I tried all described hooks, but non ist triggered in UNKNOWN. I tried CREATE and this one works like described.

Example on my VM #4:

The state:

oneadmin@devel:~$ onevm show 4
VIRTUAL MACHINE 4 INFORMATION
ID : 4
NAME : Ipfire
USER : oneadmin
GROUP : oneadmin
STATE : ACTIVE
LCM_STATE : UNKNOWN
RESCHED : No
HOST : localhost

The VM-Hook:
M_HOOK = [
name = “unknown”,
on = “CUSTOM”,
state = “ACTIVE”,
lcm_state = “UNKNOWN”,
command = “/var/lib/one/remotes/hooks/eurogard/start_unknown.sh”,
arguments = “$ID $PREV_STATE $PREV_LCM_STATE”,
remote = “no” ]

The Logs:
root@devel:~# date
Do 30. Jul 13:48:19 CEST 2015
root@devel:~# tail /var/log/one/4.log
Wed Jul 29 17:27:01 2015 [LCM][I]: New VM state is BOOT_UNKNOWN
Wed Jul 29 17:27:01 2015 [VMM][I]: Generating deployment file: /var/lib/one/vms/4/deployment.0
Wed Jul 29 17:27:01 2015 [VMM][I]: ExitCode: 0
Wed Jul 29 17:27:01 2015 [VMM][I]: Successfully execute network driver operation: pre.
Wed Jul 29 17:27:02 2015 [VMM][I]: ExitCode: 0
Wed Jul 29 17:27:02 2015 [VMM][I]: Successfully execute virtualization driver operation: deploy.
Wed Jul 29 17:27:02 2015 [VMM][I]: ExitCode: 0
Wed Jul 29 17:27:02 2015 [VMM][I]: Successfully execute network driver operation: post.
Wed Jul 29 17:27:02 2015 [LCM][I]: New VM state is RUNNING
Wed Jul 29 17:31:33 2015 [LCM][I]: New VM state is UNKNOWN

root@devel:~# grep -i hook /var/log/one/oned.log
VM_HOOK=ARGUMENTS=$ID $PREV_STATE $PREV_LCM_STATE,COMMAND=/var/lib/one/remotes/hooks/eurogard/start_unknown.sh,LCM_STATE=UNKNOWN,NAME=unknown,ON=CUSTOM,REMOTE=no,STATE=ACTIVE
VM_HOOK=ARGUMENTS=$TEMPLATE,COMMAND=/var/lib/one/remotes/hooks/eurogard/set_fw_rule.sh,NAME=create,ON=CREATE,REMOTE=no
Thu Jul 30 10:54:23 2015 [HKM][I]: Starting Hook Manager…
Thu Jul 30 10:54:23 2015 [HKM][I]: Hook Manager started.
Thu Jul 30 10:54:25 2015 [HKM][I]: Loading Hook Manager driver.
Thu Jul 30 10:54:25 2015 [HKM][I]: Hook Manager loaded

The only logentries from vm #4 are from yesterday, but i rebooted the host many times today. It seems opennebula does not touch the VM, so no hook can be triggerd. Manualy I can boot this VM easily.

What I’m doing wrong?

Thanks, Falk

The configuration is ok, we need to check why it is not triggered? Do you
restarted opennebula? I am asking this because the state check (i.e.
previous states in the hook system in <4.12 is not persistent) I.e. it need
to monitor de VM in RUNNING to detect the RUNNING->UNKNOWN transtition

I’ve created this, please update the information there:

http://dev.opennebula.org/issues/3926

On Thu, Aug 6, 2015 at 10:20 PM, Ruben S. Montero rsmontero@opennebula.org
wrote:

I don’t restart OpenNebula explicitly. I reboot the host.

I could give you ssh access, if you want to have a look.

Thanks, I’ll try to reproduce this locally

Sorry Falk, I cannot reproduce this, I just copied your conf and I get the
hook executed.

Fri Aug 14 18:01:28 2015 [Z0][ONE][E]: Error monitoring Host server (0): -
Fri Aug 14 18:01:28 2015 [Z0][HKM][D]: Message received: EXECUTE SUCCESS 0
unknown:

The hook gets executed after the VM enters unknown because of a Host
failure. I’m on 4.12