mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
feature #3654: Adjust migrate history actions and reasons, fix transition
This commit is contained in:
parent
211d0eabf2
commit
b030daa78b
@ -252,11 +252,6 @@ void LifeCycleManager::migrate_action(int vid)
|
||||
//------------------------------------------------------
|
||||
// Bypass SAVE_MIGRATE & go to PROLOG_MIGRATE_POWEROFF
|
||||
//------------------------------------------------------
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
vm->set_state(VirtualMachine::ACTIVE);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::POWEROFF)
|
||||
{
|
||||
vm->set_state(VirtualMachine::PROLOG_MIGRATE_POWEROFF);
|
||||
@ -268,6 +263,10 @@ void LifeCycleManager::migrate_action(int vid)
|
||||
vm->log("LCM", Log::INFO, "New VM state is PROLOG_MIGRATE_SUSPEND");
|
||||
}
|
||||
|
||||
vm->set_state(VirtualMachine::ACTIVE);
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
vm->delete_snapshots();
|
||||
|
||||
map<string, string> empty;
|
||||
|
@ -783,8 +783,8 @@ void LifeCycleManager::prolog_success_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(vm->get_previous_reason());
|
||||
vm->set_action(vm->get_previous_action());
|
||||
vm->set_reason(History::USER);
|
||||
vm->set_action(History::MIGRATE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@ -795,7 +795,7 @@ void LifeCycleManager::prolog_success_action(int vid)
|
||||
}
|
||||
else //PROLOG_MIGRATE_SUSPEND, PROLOG_MIGRATE_SUSPEND_FAILURE
|
||||
{
|
||||
dm->trigger(DispatchManager::POWEROFF_SUCCESS,vid);
|
||||
dm->trigger(DispatchManager::SUSPEND_SUCCESS,vid);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -926,6 +926,7 @@ void LifeCycleManager::prolog_failure_action(int vid)
|
||||
//wrong state + recover failure from failure state
|
||||
else if ( state != VirtualMachine::PROLOG_MIGRATE_FAILURE &&
|
||||
state != VirtualMachine::PROLOG_MIGRATE_POWEROFF_FAILURE &&
|
||||
state != VirtualMachine::PROLOG_MIGRATE_SUSPEND_FAILURE &&
|
||||
state != VirtualMachine::PROLOG_FAILURE )
|
||||
{
|
||||
vm->log("LCM",Log::ERROR,"prolog_failure_action, VM in a wrong state");
|
||||
|
@ -944,6 +944,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
|
||||
|
||||
if((vm->hasPreviousHistory() && vm->get_previous_reason()== History::NONE)||
|
||||
(vm->get_state() != VirtualMachine::POWEROFF &&
|
||||
vm->get_state() != VirtualMachine::SUSPENDED &&
|
||||
(vm->get_state() != VirtualMachine::ACTIVE ||
|
||||
(vm->get_lcm_state() != VirtualMachine::RUNNING &&
|
||||
vm->get_lcm_state() != VirtualMachine::UNKNOWN))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user