Capture “VM running but monitor state is POWEROFF”

Hello,

I’m trying to workaround the autostart of VM after host reboot or any KVM crash to automatically restart the VM.

I don’t want to catch normal POWEROFF of the user.

What’s the way to catch the [Z0][LCM][I]: VM running but monitor state is POWEROFF event with hooks?

Regards.

What version of ONE you using? I believe the latest version will change the VM state to running if it finds the VM still running on the host. So, you can use the “POWEROFF” state to create VM hook to start the VM again.

On the other hand, you can use host hook (failure) and re-deploy the VM in other host. But you need to careful with this as sometime the VM still running on that host but the frontend is unable to connect to host for monitoring.

Anandharaj opennebula@discoursemail.com writes:

What version of ONE you using?

5.0.2

I believe the latest version will change the VM state to running if it
finds the VM still running on the host. So, you can use the “POWEROFF”
state to create VM hook to start the VM again.

I killed the KVM process of a testing VM, here is the log:

Tue Oct  4 08:57:37 2016 [Z0][LCM][I]: VM running but monitor state is POWEROFF
Tue Oct  4 08:57:37 2016 [Z0][VM][I]: New LCM state is SHUTDOWN_POWEROFF
Tue Oct  4 08:57:37 2016 [Z0][VM][I]: New state is POWEROFF
Tue Oct  4 08:57:37 2016 [Z0][VM][I]: New LCM state is LCM_INIT

According to this log, I could not use a HOOK on POWEROFF since I
can’t make distinction between a user running onevm poweroff and the
actions run automatically with the monitoring.

On the other hand, you can use host hook (failure) and re-deploy the
VM in other host. But you need to careful with this as sometime the VM
still running on that host but the frontend is unable to connect to
host for monitoring.

We are using fencing since we have corosync/pacemaker/cLVM/GFS2, but
some time to time the whole stack get crasy on all hypervisors and they
are all rebooted :-/

I would like to manage the single node case too.

Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF