Feature #357
Need a hook when a VM becomes FAILED
Status: | Closed | Start date: | 09/30/2010 | |
---|---|---|---|---|
Priority: | High | Due 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
feature #357: Added on failed hook for VMs
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