mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
bug #265: Failure actions will *NOT* remove VM files in the host. Host files will be removed from the remote host upon VM resubmition or deletion. This will let sysadmins to easily debug any failure or perform forensic analysis.
This commit is contained in:
parent
6aa268d52f
commit
c6a8c1fbdc
@ -565,6 +565,7 @@ int DispatchManager::finalize(
|
||||
switch (state)
|
||||
{
|
||||
case VirtualMachine::SUSPENDED:
|
||||
case VirtualMachine::FAILED:
|
||||
tm->trigger(TransferManager::EPILOG_DELETE,vid);
|
||||
|
||||
case VirtualMachine::INIT:
|
||||
@ -573,7 +574,6 @@ int DispatchManager::finalize(
|
||||
case VirtualMachine::STOPPED:
|
||||
vm->set_exit_time(time(0));
|
||||
|
||||
case VirtualMachine::FAILED:
|
||||
vm->set_state(VirtualMachine::LCM_INIT);
|
||||
vm->set_state(VirtualMachine::DONE);
|
||||
vmpool->update(vm);
|
||||
@ -608,6 +608,7 @@ int DispatchManager::resubmit(int vid)
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
@ -628,9 +629,10 @@ int DispatchManager::resubmit(int vid)
|
||||
case VirtualMachine::PENDING:
|
||||
break;
|
||||
|
||||
case VirtualMachine::FAILED: //Cleanup VM host files
|
||||
tm->trigger(TransferManager::EPILOG_DELETE,vid);
|
||||
case VirtualMachine::HOLD: // Move the VM to PENDING in any of these
|
||||
case VirtualMachine::STOPPED:
|
||||
case VirtualMachine::FAILED:
|
||||
vm->set_state(VirtualMachine::LCM_INIT);
|
||||
vm->set_state(VirtualMachine::PENDING);
|
||||
vmpool->update(vm);
|
||||
|
@ -500,8 +500,7 @@ void LifeCycleManager::delete_action(int vid)
|
||||
VirtualMachine::LcmState state = vm->get_lcm_state();
|
||||
|
||||
if ((state == VirtualMachine::LCM_INIT) ||
|
||||
(state == VirtualMachine::CLEANUP) ||
|
||||
(state == VirtualMachine::FAILURE))
|
||||
(state == VirtualMachine::CLEANUP))
|
||||
{
|
||||
vm->unlock();
|
||||
return;
|
||||
@ -535,8 +534,7 @@ void LifeCycleManager::clean_action(int vid)
|
||||
VirtualMachine::LcmState state = vm->get_lcm_state();
|
||||
|
||||
if ((state == VirtualMachine::LCM_INIT) ||
|
||||
(state == VirtualMachine::CLEANUP) ||
|
||||
(state == VirtualMachine::FAILURE))
|
||||
(state == VirtualMachine::CLEANUP))
|
||||
{
|
||||
vm->unlock();
|
||||
return;
|
||||
@ -664,7 +662,11 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm)
|
||||
tm->trigger(TransferManager::EPILOG_DELETE,vid);
|
||||
break;
|
||||
|
||||
default: //FAILURE,LCM_INIT,CLEANUP
|
||||
case VirtualMachine::FAILURE:
|
||||
tm->trigger(TransferManager::EPILOG_DELETE,vid);
|
||||
break;
|
||||
|
||||
default: //LCM_INIT,CLEANUP
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -778,7 +778,6 @@ void LifeCycleManager::monitor_done_action(int vid)
|
||||
void LifeCycleManager::failure_action(VirtualMachine * vm)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
DispatchManager * dm = nd.get_dm();
|
||||
|
||||
time_t the_time = time(0);
|
||||
@ -802,11 +801,9 @@ void LifeCycleManager::failure_action(VirtualMachine * vm)
|
||||
|
||||
hpool->del_capacity(vm->get_hid(),cpu,mem,disk);
|
||||
|
||||
//------------- Clean up remote files ----------------
|
||||
//--- VM to FAILED. Remote host cleanup upon VM deletion ---
|
||||
|
||||
dm->trigger(DispatchManager::FAILED,vm->get_oid());
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_DELETE,vm->get_oid());
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user