Feature #357

Need a hook when a VM becomes FAILED

Added by Shi Jin almost 11 years ago. Updated over 10 years ago.

Status:ClosedStart date:09/30/2010
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Core & System
Target version:Release 2.2
Resolution:fixed Pull request:

Description

Hi there,

Currently, there is no hook when a VM enters a failed state.
However, it would be very useful to have a hook to handle the situation, such as sending out an notification to users/administrators about the failure.

Of course, in a ideal world, no VM should become failed but in reality they do from time to time and we need to be able to deal with this. It would be nice to provide a mechanism to fix the failure and get it back into the system but at the starting point, it is easy to add to hook.
How do you guys think?
Thanks.
Shi

Associated revisions

Revision cd05b5a1
Added by Ruben S. Montero over 10 years ago

feature #357: Added on failed hook for VMs

Revision 904edd62
Added by Sergio Semedi about 4 years ago

F #5136 ec2_driver.conf purge (#357)

  • fix opennebula log
  • F #5136 ec2_driver capacities replaced
  • F #5136 required ec2 region_name template att
  • F #5136 ec2_driver.conf removed regions
  • F #5136 decrypt moved to oca utils

History

#1 Updated by Shi Jin almost 11 years ago

It is indeed fairly straightforward to add a hook.
I inserted this code into opennebula-1.9.90/src/vm/VirtualMachinePool.cc and it worked like a charm.
@
else if ( on == "FAILED" ) {
VirtualMachineStateHook * hook;

hook = new VirtualMachineStateHook(name, cmd, arg, remote,
VirtualMachine::LCM_INIT, VirtualMachine::FAILED);
add_hook(hook);
state_hook = true;
}
@

#2 Updated by Shi Jin almost 11 years ago

The code is not formated right.
Again

        else if ( on == "FAILED" )
        {
            VirtualMachineStateHook * hook;

            hook = new VirtualMachineStateHook(name, cmd, arg, remote,
                            VirtualMachine::LCM_INIT, VirtualMachine::FAILED);
            add_hook(hook);

            state_hook = true;
        }

#3 Updated by Ruben S. Montero over 10 years ago

  • Status changed from New to Closed
  • Target version set to Release 2.2
  • Resolution set to fixed

This is now in the master branch

Also available in: Atom PDF