1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #3654: Retry PROLOG_MIGRATE_POWEROFF

(cherry picked from commit b36fe966801fe65a35f62eea86fb6fcaae13ba93)
This commit is contained in:
Ruben S. Montero 2015-04-22 19:39:26 +02:00
parent 56d743552d
commit 23aa6b0419
3 changed files with 17 additions and 6 deletions

View File

@ -1376,6 +1376,16 @@ void LifeCycleManager::retry(VirtualMachine * vm)
tm->trigger(TransferManager::PROLOG_MIGR, vid);
break;
case VirtualMachine::PROLOG_MIGRATE_POWEROFF_FAILURE:
vm->set_state(VirtualMachine::PROLOG_MIGRATE_POWEROFF);
vmpool->update(vm);
vm->log("LCM", Log::INFO, "New VM state is PROLOG_MIGRATE_POWEROFF");
tm->trigger(TransferManager::PROLOG_MIGR, vid);
break;
case VirtualMachine::PROLOG_FAILURE:
vm->set_state(VirtualMachine::PROLOG);
@ -1440,6 +1450,7 @@ void LifeCycleManager::retry(VirtualMachine * vm)
case VirtualMachine::HOTPLUG_EPILOG_POWEROFF:
case VirtualMachine::PROLOG:
case VirtualMachine::PROLOG_MIGRATE:
case VirtualMachine::PROLOG_MIGRATE_POWEROFF:
case VirtualMachine::PROLOG_RESUME:
case VirtualMachine::PROLOG_UNDEPLOY:
case VirtualMachine::MIGRATE:

View File

@ -900,6 +900,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_FAILURE )
{
vm->log("LCM",Log::ERROR,"prolog_failure_action, VM in a wrong state");

View File

@ -942,10 +942,11 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
return;
}
if((vm->get_state() != VirtualMachine::ACTIVE) ||
(vm->get_lcm_state() != VirtualMachine::RUNNING &&
vm->get_lcm_state() != VirtualMachine::UNKNOWN) ||
(vm->hasPreviousHistory() && vm->get_previous_reason() == History::NONE))
if((vm->hasPreviousHistory() && vm->get_previous_reason()== History::NONE)||
(vm->get_state() != VirtualMachine::POWEROFF &&
(vm->get_state() != VirtualMachine::ACTIVE ||
(vm->get_lcm_state() != VirtualMachine::RUNNING &&
vm->get_lcm_state() != VirtualMachine::UNKNOWN))))
{
failure_response(ACTION,
request_error("Wrong state to perform action",""),
@ -966,7 +967,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
}
// Check we are not migrating to the same host
c_hid = vm->get_hid();
if (c_hid == hid)
@ -1009,7 +1009,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
}
// Check we are in the same cluster
Host * host = nd.get_hpool()->get(c_hid, true);
if (host == 0)