1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

Feature #3654: Transitions to migrate suspended VMs

(cherry picked from commit ee7bccf48a6852117091ae3051d219cd93addd3d)
This commit is contained in:
Carlos Martín 2015-03-26 18:51:13 +01:00 committed by Ruben S. Montero
parent 8e582e331c
commit f46afca372
10 changed files with 43 additions and 7 deletions

View File

@ -148,7 +148,9 @@ public:
EPILOG_STOP_FAILURE = 41,
EPILOG_UNDEPLOY_FAILURE = 42,
PROLOG_MIGRATE_POWEROFF = 43,
PROLOG_MIGRATE_POWEROFF_FAILURE = 44
PROLOG_MIGRATE_POWEROFF_FAILURE = 44,
PROLOG_MIGRATE_SUSPEND = 45,
PROLOG_MIGRATE_SUSPEND_FAILURE = 46
};
static int lcm_state_from_str(string& st, LcmState& state)
@ -199,6 +201,8 @@ public:
else if ( st == "EPILOG_UNDEPLOY_FAILURE") { state = EPILOG_UNDEPLOY_FAILURE; }
else if ( st == "PROLOG_MIGRATE_POWEROFF") { state = PROLOG_MIGRATE_POWEROFF;}
else if ( st == "PROLOG_MIGRATE_POWEROFF_FAILURE") { state = PROLOG_MIGRATE_POWEROFF_FAILURE;}
else if ( st == "PROLOG_MIGRATE_SUSPEND") { state = PROLOG_MIGRATE_SUSPEND;}
else if ( st == "PROLOG_MIGRATE_SUSPEND_FAILURE") { state = PROLOG_MIGRATE_SUSPEND_FAILURE;}
else {return -1;}
return 0;
@ -252,6 +256,8 @@ public:
case EPILOG_UNDEPLOY_FAILURE: st = "EPILOG_UNDEPLOY_FAILURE"; break;
case PROLOG_MIGRATE_POWEROFF: st = "PROLOG_MIGRATE_POWEROFF"; break;
case PROLOG_MIGRATE_POWEROFF_FAILURE: st = "PROLOG_MIGRATE_POWEROFF_FAILURE"; break;
case PROLOG_MIGRATE_SUSPEND: st = "PROLOG_MIGRATE_SUSPEND"; break;
case PROLOG_MIGRATE_SUSPEND_FAILURE: st = "PROLOG_MIGRATE_SUSPEND_FAILURE"; break;
}
return st;

View File

@ -26,7 +26,7 @@ digraph OpenNebula {
subgraph { rank = same; boot; boot_stopped; boot_undeploy; boot_suspended; boot_unknown; boot_poweroff; boot_migrate; boot_failure; boot_migrate_failure; color="white"}
subgraph { rank = same; running; unknown; color="white"}
subgraph { rank = same; pending; hold; color="white"}
subgraph { rank = same; prolog; prolog_failure; prolog_resume; prolog_migrate; prolog_migrate_failure; prolog_migrate_poweroff; prolog_migrate_poweroff_failure; prolog_undeploy; color="white" }
subgraph { rank = same; prolog; prolog_failure; prolog_resume; prolog_migrate; prolog_migrate_failure; prolog_migrate_poweroff; prolog_migrate_poweroff_failure; prolog_migrate_suspend; prolog_migrate_suspend_failure; prolog_undeploy; 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 = sink; done; failure; ANY; color="white" }
@ -85,6 +85,9 @@ digraph OpenNebula {
poweroff -> prolog_migrate_poweroff [label="migrate"];
prolog_migrate_poweroff -> poweroff [style="dashed", color="blue"];
suspended -> prolog_migrate_suspend [label="migrate"];
prolog_migrate_suspend -> suspended [style="dashed", color="blue"];
# hold
pending -> hold [label="hold"];
@ -193,6 +196,9 @@ digraph OpenNebula {
prolog_migrate_poweroff -> prolog_migrate_poweroff_failure [label=" ", style="dotted", color="red"];
prolog_migrate_poweroff_failure -> prolog_migrate_poweroff [label="migrate"];
prolog_migrate_suspend -> prolog_migrate_suspend_failure [label=" ", style="dotted", color="red"];
prolog_migrate_suspend_failure -> prolog_migrate_suspend [label="migrate"];
prolog_resume -> stopped [style="dotted", color="red"];
prolog_undeploy -> undeployed [style="dotted", color="red"];

View File

@ -157,7 +157,9 @@
EPILOG_STOP_FAILURE = 41,
EPILOG_UNDEPLOY_FAILURE = 42,
PROLOG_MIGRATE_POWEROFF = 43,
PROLOG_MIGRATE_POWEROFF_FAILURE = 44
PROLOG_MIGRATE_POWEROFF_FAILURE = 44,
PROLOG_MIGRATE_SUSPEND = 45,
PROLOG_MIGRATE_SUSPEND_FAILURE = 46
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="PREV_STATE" type="xs:integer"/>

View File

@ -90,7 +90,9 @@
EPILOG_STOP_FAILURE = 41,
EPILOG_UNDEPLOY_FAILURE = 42,
PROLOG_MIGRATE_POWEROFF = 43,
PROLOG_MIGRATE_POWEROFF_FAILURE = 44
PROLOG_MIGRATE_POWEROFF_FAILURE = 44,
PROLOG_MIGRATE_SUSPEND = 45,
PROLOG_MIGRATE_SUSPEND_FAILURE = 46
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="PREV_STATE" type="xs:integer"/>

View File

@ -121,7 +121,9 @@ public class VirtualMachine extends PoolElement{
"EPILOG_STOP_FAILURE",
"EPILOG_UNDEPLOY_FAILURE",
"PROLOG_MIGRATE_POWEROFF",
"PROLOG_MIGRATE_POWEROFF_FAILURE"
"PROLOG_MIGRATE_POWEROFF_FAILURE",
"PROLOG_MIGRATE_SUSPEND",
"PROLOG_MIGRATE_SUSPEND_FAILURE"
};
private static final String[] SHORT_LCM_STATES =
@ -170,7 +172,9 @@ public class VirtualMachine extends PoolElement{
"fail", // EPILOG_STOP_FAILURE
"fail", // EPILOG_UNDEPLOY_FAILURE
"migr", // PROLOG_MIGRATE_POWEROFF
"fail" // PROLOG_MIGRATE_POWEROFF_FAILURE
"fail", // PROLOG_MIGRATE_POWEROFF_FAILURE
"migr", // PROLOG_MIGRATE_SUSPEND
"fail" // PROLOG_MIGRATE_SUSPEND_FAILURE
};
/**

View File

@ -95,6 +95,8 @@ module OpenNebula
EPILOG_UNDEPLOY_FAILURE
PROLOG_MIGRATE_POWEROFF
PROLOG_MIGRATE_POWEROFF_FAILURE
PROLOG_MIGRATE_SUSPEND
PROLOG_MIGRATE_SUSPEND_FAILURE
}
SHORT_VM_STATES={
@ -155,6 +157,8 @@ module OpenNebula
"EPILOG_UNDEPLOY_FAILURE" => "fail",
"PROLOG_MIGRATE_POWEROFF" => "migr",
"PROLOG_MIGRATE_POWEROFF_FAILURE" => "fail",
"PROLOG_MIGRATE_SUSPEND" => "migr",
"PROLOG_MIGRATE_SUSPEND_FAILURE" => "fail",
}
MIGRATE_REASON=%w{NONE ERROR USER}

View File

@ -77,6 +77,8 @@ VNC_STATES = [
#42, #EPILOG_UNDEPLOY_FAILURE
#43, #PROLOG_MIGRATE_POWEROFF
#44, #PROLOG_MIGRATE_POWEROFF_FAILURE
#45, #PROLOG_MIGRATE_SUSPEND
#46, #PROLOG_MIGRATE_SUSPEND_FAILURE
]
class OpenNebulaVNC

View File

@ -163,6 +163,8 @@ var OpenNebula = {
"FAILURE", // EPILOG_UNDEPLOY_FAILURE
"MIGRATE", // PROLOG_MIGRATE_POWEROFF
"FAILURE" // PROLOG_MIGRATE_POWEROFF_FAILURE
"MIGRATE", // PROLOG_MIGRATE_SUSPEND
"FAILURE" // PROLOG_MIGRATE_SUSPEND_FAILURE
][value]);
break;
case "IMAGE":
@ -962,7 +964,9 @@ var OpenNebula = {
"EPILOG_STOP_FAILURE" : 41,
"EPILOG_UNDEPLOY_FAILURE" : 42,
"PROLOG_MIGRATE_POWEROFF" : 43,
"PROLOG_MIGRATE_POWEROFF_FAILURE" : 44
"PROLOG_MIGRATE_POWEROFF_FAILURE" : 44,
"PROLOG_MIGRATE_SUSPEND" : 45,
"PROLOG_MIGRATE_SUSPEND_FAILURE" : 46
},
"create": function(params){

View File

@ -169,6 +169,10 @@ var lcm_state_actions = {
[],
44: //OpenNebula.VM.lcm_state.PROLOG_MIGRATE_POWEROFF_FAILURE:
[],
45: //OpenNebula.VM.lcm_state.PROLOG_MIGRATE_SUSPEND:
[],
46: //OpenNebula.VM.lcm_state.PROLOG_MIGRATE_SUSPEND_FAILURE:
[],
}
//Permanent storage for last value of aggregated network usage

View File

@ -122,6 +122,7 @@ void TransferManagerDriver::protocol(const string& message) const
case VirtualMachine::PROLOG_RESUME:
case VirtualMachine::PROLOG_UNDEPLOY:
case VirtualMachine::PROLOG_MIGRATE_POWEROFF:
case VirtualMachine::PROLOG_MIGRATE_SUSPEND:
lcm_action = LifeCycleManager::PROLOG_SUCCESS;
break;
@ -176,6 +177,7 @@ void TransferManagerDriver::protocol(const string& message) const
case VirtualMachine::PROLOG_RESUME:
case VirtualMachine::PROLOG_UNDEPLOY:
case VirtualMachine::PROLOG_MIGRATE_POWEROFF:
case VirtualMachine::PROLOG_MIGRATE_SUSPEND:
lcm_action = LifeCycleManager::PROLOG_FAILURE;
break;