mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
Feature #3654: Transitions to recover a failed epilog
(cherry picked from commit 75a275d0115390dd2cc2dab4dbb8d83bd3c3d32d)
This commit is contained in:
parent
5f4066c7e1
commit
f8c728639c
@ -145,7 +145,10 @@ public:
|
||||
BOOT_FAILURE = 36,
|
||||
BOOT_MIGRATE_FAILURE = 37,
|
||||
PROLOG_MIGRATE_FAILURE = 38,
|
||||
PROLOG_FAILURE = 39
|
||||
PROLOG_FAILURE = 39,
|
||||
EPILOG_FAILURE = 40,
|
||||
EPILOG_STOP_FAILURE = 41,
|
||||
EPILOG_UNDEPLOY_FAILURE = 42
|
||||
};
|
||||
|
||||
static int lcm_state_from_str(string& st, LcmState& state)
|
||||
@ -192,6 +195,9 @@ public:
|
||||
else if ( st == "BOOT_MIGRATE_FAILURE") { state = BOOT_MIGRATE_FAILURE; }
|
||||
else if ( st == "PROLOG_MIGRATE_FAILURE") { state = PROLOG_MIGRATE_FAILURE; }
|
||||
else if ( st == "PROLOG_FAILURE") { state = PROLOG_FAILURE; }
|
||||
else if ( st == "EPILOG_FAILURE") { state = EPILOG_FAILURE; }
|
||||
else if ( st == "EPILOG_STOP_FAILURE") { state = EPILOG_STOP_FAILURE; }
|
||||
else if ( st == "EPILOG_UNDEPLOY_FAILURE") { state = EPILOG_UNDEPLOY_FAILURE; }
|
||||
else {return -1;}
|
||||
|
||||
return 0;
|
||||
@ -241,6 +247,9 @@ public:
|
||||
case BOOT_MIGRATE_FAILURE: st = "BOOT_MIGRATE_FAILURE"; break;
|
||||
case PROLOG_MIGRATE_FAILURE: st = "PROLOG_MIGRATE_FAILURE"; break;
|
||||
case PROLOG_FAILURE: st = "PROLOG_FAILURE"; break;
|
||||
case EPILOG_FAILURE: st = "EPILOG_FAILURE"; break;
|
||||
case EPILOG_STOP_FAILURE: st = "EPILOG_STOP_FAILURE"; break;
|
||||
case EPILOG_UNDEPLOY_FAILURE: st = "EPILOG_UNDEPLOY_FAILURE"; break;
|
||||
}
|
||||
|
||||
return st;
|
||||
|
@ -5,6 +5,7 @@ digraph OpenNebula {
|
||||
nodesep=0.5,
|
||||
ratio=0.5,
|
||||
pad=0.5,
|
||||
//concentrate=true,
|
||||
];
|
||||
|
||||
node [fontname="Helvetica"];
|
||||
@ -24,7 +25,7 @@ digraph OpenNebula {
|
||||
subgraph { rank = same; boot; boot_stopped; boot_undeploy; boot_suspended; boot_unknown; boot_poweroff; boot_migrate; boot_failure; boot_migrate_failure; unknown; color="white"}
|
||||
subgraph { rank = same; pending; hold; color="white"}
|
||||
subgraph { rank = same; prolog; prolog_failure; prolog_resume; prolog_migrate; prolog_migrate_failure; color="white" }
|
||||
subgraph { rank = same; hotplug_prolog_poweroff; hotplug_saveas_poweroff; hotplug_saveas_suspended; epilog_stop; epilog; epilog_undeploy; hotplug_epilog_poweroff; color="white" }
|
||||
subgraph { rank = same; hotplug_prolog_poweroff; hotplug_saveas_poweroff; hotplug_saveas_suspended; epilog_stop; epilog; epilog_undeploy; epilog_stop_failure; epilog_failure; epilog_undeploy_failure; hotplug_epilog_poweroff; color="white" }
|
||||
subgraph { rank = same; suspended; stopped; undeployed; poweroff; color="white" }
|
||||
subgraph { rank = sink; done; failure; ANY; color="white" }
|
||||
|
||||
@ -33,44 +34,44 @@ digraph OpenNebula {
|
||||
|
||||
# deploy
|
||||
pending -> prolog [label="deploy"];
|
||||
prolog -> boot [style="dashed"];
|
||||
boot -> running [style="dashed"];
|
||||
prolog -> boot [style="dashed", color="blue"];
|
||||
boot -> running [style="dashed", color="blue"];
|
||||
|
||||
pending -> prolog_resume [label="deploy\n(from stopped)"];
|
||||
prolog_resume -> boot_stopped [style="dashed"];
|
||||
prolog_resume -> boot_stopped [style="dashed", color="blue"];
|
||||
|
||||
pending -> prolog_undeploy [label="deploy\n(from undeployed)"];
|
||||
prolog_undeploy -> boot_undeploy [style="dashed"];
|
||||
prolog_undeploy -> boot_undeploy [style="dashed", color="blue"];
|
||||
|
||||
# shutdown
|
||||
running -> shutdown [label="shutdown"];
|
||||
shutdown -> epilog [style="dashed"];
|
||||
epilog -> done [style="dashed"];
|
||||
shutdown -> epilog [style="dashed", color="blue"];
|
||||
epilog -> done [style="dashed", color="blue"];
|
||||
|
||||
shutdown -> running [style="dotted"];
|
||||
shutdown -> running [style="dotted", color="red"];
|
||||
|
||||
# shutdown --hard
|
||||
running -> cancel [label="shutdown --hard"];
|
||||
cancel -> epilog [style="dashed"];
|
||||
cancel -> running [style="dotted"];
|
||||
cancel -> epilog [style="dashed", color="blue"];
|
||||
cancel -> running [style="dotted", color="red"];
|
||||
unknown -> epilog [label="shutdown --hard"];
|
||||
|
||||
# poweroff
|
||||
running -> shutdown_poweroff [label="poweroff [--hard]"];
|
||||
shutdown_poweroff -> poweroff [style="dashed"];
|
||||
shutdown_poweroff -> poweroff [style="dashed", color="blue"];
|
||||
|
||||
shutdown_poweroff -> running [style="dotted"];
|
||||
shutdown_poweroff -> running [style="dotted", color="red"];
|
||||
|
||||
# livemigrate
|
||||
running -> migrate [label="migrate --live"];
|
||||
migrate -> running [style="dashed"];
|
||||
migrate -> running [style="dashed", color="blue"];
|
||||
|
||||
# migrate
|
||||
running -> save_migrate [label="migrate"];
|
||||
save_migrate -> prolog_migrate [style="dashed"];
|
||||
save_migrate -> running [style="dotted"];
|
||||
prolog_migrate -> boot_migrate [style="dashed"];
|
||||
boot_migrate -> running [style="dashed"];
|
||||
save_migrate -> prolog_migrate [style="dashed", color="blue"];
|
||||
save_migrate -> running [style="dotted", color="red"];
|
||||
prolog_migrate -> boot_migrate [style="dashed", color="blue"];
|
||||
boot_migrate -> running [style="dashed", color="blue"];
|
||||
|
||||
# hold
|
||||
pending -> hold [label="hold"];
|
||||
@ -80,33 +81,33 @@ digraph OpenNebula {
|
||||
|
||||
# stop
|
||||
running -> save_stop [label="stop"];
|
||||
save_stop -> epilog_stop [style="dashed"];
|
||||
save_stop -> running [style="dotted"];
|
||||
epilog_stop -> stopped [style="dashed"];
|
||||
save_stop -> epilog_stop [style="dashed", color="blue"];
|
||||
save_stop -> running [style="dotted", color="red"];
|
||||
epilog_stop -> stopped [style="dashed", color="blue"];
|
||||
|
||||
# undeploy
|
||||
running -> shutdown_undeploy [label="undeploy [--hard]"];
|
||||
shutdown_undeploy -> epilog_undeploy [style="dashed"];
|
||||
shutdown_undeploy -> running [style="dotted"];
|
||||
epilog_undeploy -> undeployed [style="dashed"];
|
||||
shutdown_undeploy -> epilog_undeploy [style="dashed", color="blue"];
|
||||
shutdown_undeploy -> running [style="dotted", color="red"];
|
||||
epilog_undeploy -> undeployed [style="dashed", color="blue"];
|
||||
|
||||
# suspend
|
||||
running -> save_suspend [label="suspend"];
|
||||
save_suspend -> suspended [style="dashed"];
|
||||
save_suspend -> running [style="dotted"];
|
||||
save_suspend -> suspended [style="dashed", color="blue"];
|
||||
save_suspend -> running [style="dotted", color="red"];
|
||||
|
||||
# resume
|
||||
stopped -> pending [label="resume"];
|
||||
boot_stopped -> running [style="dashed"];
|
||||
boot_stopped -> running [style="dashed", color="blue"];
|
||||
|
||||
undeployed -> pending [label="resume"];
|
||||
boot_undeploy -> running [style="dashed"];
|
||||
boot_undeploy -> running [style="dashed", color="blue"];
|
||||
|
||||
suspended -> boot_suspended [label="resume"];
|
||||
boot_suspended -> running [style="dashed"];
|
||||
boot_suspended -> running [style="dashed", color="blue"];
|
||||
|
||||
poweroff -> boot_poweroff [label="resume"];
|
||||
boot_poweroff -> running [style="dashed"];
|
||||
boot_poweroff -> running [style="dashed", color="blue"];
|
||||
|
||||
# delete
|
||||
ANY -> done [label="delete"];
|
||||
@ -124,7 +125,7 @@ digraph OpenNebula {
|
||||
|
||||
unknown -> boot_unknown [label="boot"];
|
||||
boot_unknown -> boot_unknown [label="boot"];
|
||||
boot_unknown -> running [style="dashed"];
|
||||
boot_unknown -> running [style="dashed", color="blue"];
|
||||
|
||||
boot_failure -> boot [label="recover"];
|
||||
boot_migrate_failure -> boot_migrate [label="recover"];
|
||||
@ -134,61 +135,66 @@ digraph OpenNebula {
|
||||
|
||||
# disk-attach
|
||||
running -> hotplug [label="disk-attach /\n-detach"]
|
||||
hotplug -> running [style="dashed"];
|
||||
hotplug -> running [style="dashed", color="blue"];
|
||||
|
||||
poweroff -> hotplug_prolog_poweroff [label="disk-attach"]
|
||||
hotplug_prolog_poweroff -> poweroff [style="dashed"];
|
||||
hotplug_prolog_poweroff -> poweroff [style="dashed", color="blue"];
|
||||
poweroff -> hotplug_epilog_poweroff [label="disk-detach"]
|
||||
hotplug_epilog_poweroff -> poweroff [style="dashed"];
|
||||
hotplug_epilog_poweroff -> poweroff [style="dashed", color="blue"];
|
||||
|
||||
# nic-attach
|
||||
running -> hotplug_nic [label="nic-attach /\n-detach"]
|
||||
hotplug_nic -> running [style="dashed"];
|
||||
hotplug_nic -> running [style="dashed", color="blue"];
|
||||
|
||||
poweroff -> poweroff [label="nic-attach /\n-detach"]
|
||||
|
||||
# snapshot
|
||||
running -> hotplug_snapshot [label="snapshot-create /\n-revert /\n-delete"]
|
||||
hotplug_snapshot -> running [style="dashed"];
|
||||
hotplug_snapshot -> running [style="dashed", color="blue"];
|
||||
|
||||
# disk-snapshot
|
||||
running -> hotplug_saveas [label="disk-snapshot"]
|
||||
hotplug_saveas -> running [style="dashed"];
|
||||
hotplug_saveas -> running [style="dashed", color="blue"];
|
||||
|
||||
poweroff -> hotplug_saveas_poweroff [label="disk-snapshot"]
|
||||
hotplug_saveas_poweroff -> poweroff [style="dashed"];
|
||||
hotplug_saveas_poweroff -> poweroff [style="dashed", color="blue"];
|
||||
|
||||
suspended -> hotplug_saveas_suspended [label="disk-snapshot"]
|
||||
hotplug_saveas_suspended -> suspended [style="dashed"];
|
||||
hotplug_saveas_suspended -> suspended [style="dashed", color="blue"];
|
||||
|
||||
# failures and misc.
|
||||
epilog_stop -> failure [style="dotted"];
|
||||
epilog -> failure [style="dotted"];
|
||||
epilog_undeploy -> failure [style="dotted"];
|
||||
epilog_stop -> epilog_stop_failure [label=" ", style="dotted", color="red"];
|
||||
epilog_stop_failure -> epilog_stop [label="recover"];
|
||||
|
||||
prolog -> prolog_failure [style="dotted"];
|
||||
epilog -> epilog_failure [label=" ", style="dotted", color="red"];
|
||||
epilog_failure -> epilog [label="recover"];
|
||||
|
||||
epilog_undeploy -> epilog_undeploy_failure [label=" ", style="dotted", color="red"];
|
||||
epilog_undeploy_failure -> epilog_undeploy [label="recover"];
|
||||
|
||||
prolog -> prolog_failure [label=" ", style="dotted", color="red"];
|
||||
prolog_failure -> prolog [label="recover"];
|
||||
|
||||
prolog_migrate -> prolog_migrate_failure [style="dotted"];
|
||||
prolog_migrate -> prolog_migrate_failure [label=" ", style="dotted", color="red"];
|
||||
prolog_migrate_failure -> prolog_migrate [label="recover"];
|
||||
|
||||
prolog_resume -> stopped [style="dotted"];
|
||||
prolog_undeploy -> undeployed [style="dotted"];
|
||||
prolog_resume -> stopped [style="dotted", color="red"];
|
||||
prolog_undeploy -> undeployed [style="dotted", color="red"];
|
||||
|
||||
boot -> boot_failure [style="dotted"];
|
||||
boot_migrate -> boot_migrate_failure [style="dotted"];
|
||||
boot_poweroff -> poweroff [style="dotted"];
|
||||
boot_unknown -> unknown [style="dotted"];
|
||||
boot_suspended -> suspended [style="dotted"];
|
||||
boot_stopped -> epilog_stop [style="dotted"];
|
||||
boot_undeploy -> epilog_undeploy [style="dotted"];
|
||||
boot -> boot_failure [label=" ", style="dotted", color="red"];
|
||||
boot_migrate -> boot_migrate_failure [label=" ", style="dotted", color="red"];
|
||||
boot_poweroff -> poweroff [style="dotted", color="red"];
|
||||
boot_unknown -> unknown [label=" ", style="dotted", color="red"];
|
||||
boot_suspended -> suspended [style="dotted", color="red"];
|
||||
boot_stopped -> epilog_stop [style="dotted", color="red"];
|
||||
boot_undeploy -> epilog_undeploy [style="dotted", color="red"];
|
||||
|
||||
running -> failure [style="dotted"];
|
||||
unknown -> failure [style="dotted"];
|
||||
running -> failure [style="dotted", color="red"];
|
||||
unknown -> failure [style="dotted", color="red"];
|
||||
|
||||
running -> save_suspend [style="dotted"];
|
||||
unknown -> save_suspend [style="dotted"];
|
||||
running -> save_suspend [style="dotted", color="red"];
|
||||
unknown -> save_suspend [style="dotted", color="red"];
|
||||
|
||||
running -> unknown [style="dotted"];
|
||||
unknown -> running [style="dashed"];
|
||||
running -> unknown [style="dotted", color="red"];
|
||||
unknown -> running [style="dashed", color="blue"];
|
||||
}
|
||||
|
@ -148,7 +148,10 @@
|
||||
BOOT_FAILURE = 36,
|
||||
BOOT_MIGRATE_FAILURE = 37,
|
||||
PROLOG_MIGRATE_FAILURE = 38,
|
||||
PROLOG_FAILURE = 39
|
||||
PROLOG_FAILURE = 39,
|
||||
EPILOG_FAILURE = 40,
|
||||
EPILOG_STOP_FAILURE = 41,
|
||||
EPILOG_UNDEPLOY_FAILURE = 42
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="PREV_STATE" type="xs:integer"/>
|
||||
|
@ -85,7 +85,10 @@
|
||||
BOOT_FAILURE = 36,
|
||||
BOOT_MIGRATE_FAILURE = 37,
|
||||
PROLOG_MIGRATE_FAILURE = 38,
|
||||
PROLOG_FAILURE = 39
|
||||
PROLOG_FAILURE = 39,
|
||||
EPILOG_FAILURE = 40,
|
||||
EPILOG_STOP_FAILURE = 41,
|
||||
EPILOG_UNDEPLOY_FAILURE = 42
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="PREV_STATE" type="xs:integer"/>
|
||||
|
@ -236,7 +236,8 @@ int DispatchManager::shutdown (
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_FAILURE))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
@ -284,7 +285,8 @@ int DispatchManager::undeploy(
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_UNDEPLOY_FAILURE))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
@ -481,8 +483,9 @@ int DispatchManager::stop(
|
||||
oss << "Stopping VM " << vid;
|
||||
NebulaLog::log("DiM",Log::DEBUG,oss);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::RUNNING )
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_STOP_FAILURE))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
@ -528,7 +531,8 @@ int DispatchManager::cancel(
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_FAILURE))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
|
@ -176,6 +176,10 @@ void LifeCycleManager::suspend_action(int vid)
|
||||
|
||||
void LifeCycleManager::stop_action(int vid)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
|
||||
VirtualMachine * vm;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
@ -188,9 +192,6 @@ void LifeCycleManager::stop_action(int vid)
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::RUNNING)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
|
||||
//----------------------------------------------------
|
||||
// SAVE_STOP STATE
|
||||
//----------------------------------------------------
|
||||
@ -211,6 +212,23 @@ void LifeCycleManager::stop_action(int vid)
|
||||
|
||||
vmm->trigger(VirtualMachineManager::SAVE,vid);
|
||||
}
|
||||
else if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_STOP_FAILURE)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// Bypass SAVE_STOP
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG_STOP);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_STOP");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM", Log::ERROR, "stop_action, VM in a wrong state.");
|
||||
@ -396,6 +414,10 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
if ( vm == 0 )
|
||||
@ -407,9 +429,6 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
|
||||
//----------------------------------------------------
|
||||
// SHUTDOWN STATE
|
||||
//----------------------------------------------------
|
||||
@ -430,6 +449,23 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
|
||||
vmm->trigger(VirtualMachineManager::SHUTDOWN,vid);
|
||||
}
|
||||
else if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_FAILURE)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// Bypass SHUTDOWN
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM", Log::ERROR, "shutdown_action, VM in a wrong state.");
|
||||
@ -445,6 +481,10 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
|
||||
void LifeCycleManager::undeploy_action(int vid, bool hard)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
|
||||
VirtualMachine * vm;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
@ -458,9 +498,6 @@ void LifeCycleManager::undeploy_action(int vid, bool hard)
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
|
||||
//----------------------------------------------------
|
||||
// SHUTDOWN_UNDEPLOY STATE
|
||||
//----------------------------------------------------
|
||||
@ -490,6 +527,23 @@ void LifeCycleManager::undeploy_action(int vid, bool hard)
|
||||
|
||||
vmpool->update_history(vm);
|
||||
}
|
||||
else if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_UNDEPLOY_FAILURE)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// Bypass SHUTDOWN_UNDEPLOY
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_UNDEPLOY");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM", Log::ERROR, "undeploy_action, VM in a wrong state.");
|
||||
@ -642,6 +696,10 @@ void LifeCycleManager::cancel_action(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
if ( vm == 0 )
|
||||
@ -653,9 +711,6 @@ void LifeCycleManager::cancel_action(int vid)
|
||||
(vm->get_lcm_state() == VirtualMachine::RUNNING ||
|
||||
vm->get_lcm_state() == VirtualMachine::UNKNOWN))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
|
||||
//----------------------------------------------------
|
||||
// CANCEL STATE
|
||||
//----------------------------------------------------
|
||||
@ -676,6 +731,23 @@ void LifeCycleManager::cancel_action(int vid)
|
||||
|
||||
vmm->trigger(VirtualMachineManager::CANCEL,vid);
|
||||
}
|
||||
else if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_FAILURE)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// Bypass CANCEL
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM", Log::ERROR, "cancel_action, VM in a wrong state.");
|
||||
@ -1218,6 +1290,9 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag
|
||||
case VirtualMachine::EPILOG_STOP:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY:
|
||||
case VirtualMachine::EPILOG:
|
||||
case VirtualMachine::EPILOG_FAILURE:
|
||||
case VirtualMachine::EPILOG_STOP_FAILURE:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY_FAILURE:
|
||||
vm->set_epilog_etime(the_time);
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@ -1291,6 +1366,9 @@ void LifeCycleManager::recover(VirtualMachine * vm, bool success)
|
||||
case VirtualMachine::EPILOG:
|
||||
case VirtualMachine::EPILOG_STOP:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY:
|
||||
case VirtualMachine::EPILOG_FAILURE:
|
||||
case VirtualMachine::EPILOG_STOP_FAILURE:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY_FAILURE:
|
||||
if (success)
|
||||
{
|
||||
lcm_action = LifeCycleManager::EPILOG_SUCCESS;
|
||||
|
@ -901,6 +901,30 @@ void LifeCycleManager::epilog_success_action(int vid)
|
||||
|
||||
state = vm->get_lcm_state();
|
||||
|
||||
if ( state == VirtualMachine::EPILOG_STOP_FAILURE )
|
||||
{
|
||||
vm->set_state(VirtualMachine::EPILOG_STOP);
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_STOP");
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG_UNDEPLOY_FAILURE )
|
||||
{
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY);
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_UNDEPLOY");
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG_FAILURE )
|
||||
{
|
||||
vm->set_state(VirtualMachine::EPILOG);
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG");
|
||||
}
|
||||
|
||||
state = vm->get_lcm_state();
|
||||
|
||||
if ( state == VirtualMachine::EPILOG_STOP )
|
||||
{
|
||||
action = DispatchManager::STOP_SUCCESS;
|
||||
@ -992,7 +1016,8 @@ void LifeCycleManager::cleanup_callback_action(int vid)
|
||||
void LifeCycleManager::epilog_failure_action(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
time_t the_time = time(0);
|
||||
|
||||
VirtualMachine::LcmState state;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
@ -1001,20 +1026,35 @@ void LifeCycleManager::epilog_failure_action(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( vm->get_lcm_state() == VirtualMachine::CLEANUP_RESUBMIT )
|
||||
state = vm->get_lcm_state();
|
||||
|
||||
if ( state == VirtualMachine::CLEANUP_RESUBMIT )
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
DispatchManager * dm = nd.get_dm();
|
||||
|
||||
dm->trigger(DispatchManager::RESUBMIT, vid);
|
||||
}
|
||||
else if ( vm->get_lcm_state() == VirtualMachine::EPILOG_STOP ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_UNDEPLOY ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG )
|
||||
else if ( state == VirtualMachine::EPILOG )
|
||||
{
|
||||
vm->set_epilog_etime(the_time);
|
||||
vm->set_state(VirtualMachine::EPILOG_FAILURE);
|
||||
vmpool->update(vm);
|
||||
|
||||
failure_action(vm);
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_FAILURE");
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG_STOP )
|
||||
{
|
||||
vm->set_state(VirtualMachine::EPILOG_STOP_FAILURE);
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_STOP_FAILURE");
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG_UNDEPLOY )
|
||||
{
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY_FAILURE);
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_UNDEPLOY_FAILURE");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -116,7 +116,10 @@ public class VirtualMachine extends PoolElement{
|
||||
"BOOT_FAILURE",
|
||||
"BOOT_MIGRATE_FAILURE",
|
||||
"PROLOG_MIGRATE_FAILURE",
|
||||
"PROLOG_FAILURE" };
|
||||
"PROLOG_FAILURE",
|
||||
"EPILOG_FAILURE",
|
||||
"EPILOG_STOP_FAILURE",
|
||||
"EPILOG_UNDEPLOY_FAILURE" };
|
||||
|
||||
private static final String[] SHORT_LCM_STATES =
|
||||
{
|
||||
@ -159,7 +162,11 @@ public class VirtualMachine extends PoolElement{
|
||||
"fail", // BOOT_FAILURE
|
||||
"fail", // BOOT_MIGRATE_FAILURE
|
||||
"fail", // PROLOG_MIGRATE_FAILURE
|
||||
"fail" }; // PROLOG_FAILURE
|
||||
"fail", // PROLOG_FAILURE
|
||||
"fail", // EPILOG_FAILURE
|
||||
"fail", // EPILOG_STOP_FAILURE
|
||||
"fail" // EPILOG_UNDEPLOY_FAILURE
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new VM representation.
|
||||
|
@ -90,6 +90,9 @@ module OpenNebula
|
||||
BOOT_MIGRATE_FAILURE
|
||||
PROLOG_MIGRATE_FAILURE
|
||||
PROLOG_FAILURE
|
||||
EPILOG_FAILURE
|
||||
EPILOG_STOP_FAILURE
|
||||
EPILOG_UNDEPLOY_FAILURE
|
||||
}
|
||||
|
||||
SHORT_VM_STATES={
|
||||
@ -144,7 +147,10 @@ module OpenNebula
|
||||
"BOOT_FAILURE" => "fail",
|
||||
"BOOT_MIGRATE_FAILURE" => "fail",
|
||||
"PROLOG_MIGRATE_FAILURE" => "fail",
|
||||
"PROLOG_FAILURE" => "fail"
|
||||
"PROLOG_FAILURE" => "fail",
|
||||
"EPILOG_FAILURE" => "fail",
|
||||
"EPILOG_STOP_FAILURE" => "fail",
|
||||
"EPILOG_UNDEPLOY_FAILURE" => "fail",
|
||||
}
|
||||
|
||||
MIGRATE_REASON=%w{NONE ERROR USER}
|
||||
|
@ -72,6 +72,9 @@ VNC_STATES = [
|
||||
#37, #BOOT_MIGRATE_FAILURE
|
||||
#38, #PROLOG_MIGRATE_FAILURE
|
||||
#39, #PROLOG_FAILURE
|
||||
#40, #EPILOG_FAILURE
|
||||
#41, #EPILOG_STOP_FAILURE
|
||||
#42, #EPILOG_UNDEPLOY_FAILURE
|
||||
]
|
||||
|
||||
class OpenNebulaVNC
|
||||
|
@ -157,7 +157,10 @@ var OpenNebula = {
|
||||
"FAILURE", // BOOT_FAILURE
|
||||
"FAILURE", // BOOT_MIGRATE_FAILURE
|
||||
"FAILURE", // PROLOG_MIGRATE_FAILURE
|
||||
"FAILURE" // PROLOG_FAILURE
|
||||
"FAILURE", // PROLOG_FAILURE
|
||||
"FAILURE", // EPILOG_FAILURE
|
||||
"FAILURE", // EPILOG_STOP_FAILURE
|
||||
"FAILURE" // EPILOG_UNDEPLOY_FAILURE
|
||||
][value]);
|
||||
break;
|
||||
case "IMAGE":
|
||||
@ -948,7 +951,10 @@ var OpenNebula = {
|
||||
"BOOT_FAILURE" : 36,
|
||||
"BOOT_MIGRATE_FAILURE" : 37,
|
||||
"PROLOG_MIGRATE_FAILURE" : 38,
|
||||
"PROLOG_FAILURE" : 39
|
||||
"PROLOG_FAILURE" : 39,
|
||||
"EPILOG_FAILURE" : 40,
|
||||
"EPILOG_STOP_FAILURE" : 41,
|
||||
"EPILOG_UNDEPLOY_FAILURE" : 42
|
||||
},
|
||||
|
||||
"create": function(params){
|
||||
|
@ -159,6 +159,12 @@ var lcm_state_actions = {
|
||||
[],
|
||||
39: //OpenNebula.VM.lcm_state.PROLOG_FAILURE:
|
||||
[],
|
||||
40: //OpenNebula.VM.lcm_state.EPILOG_FAILURE:
|
||||
[],
|
||||
41: //OpenNebula.VM.lcm_state.EPILOG_STOP_FAILURE:
|
||||
[],
|
||||
42: //OpenNebula.VM.lcm_state.EPILOG_UNDEPLOY_FAILURE:
|
||||
[],
|
||||
}
|
||||
|
||||
//Permanent storage for last value of aggregated network usage
|
||||
|
Loading…
Reference in New Issue
Block a user