Bug #1557: Add BOOT_UNKNOWN state to CLI, and OCA (both Ruby & Java)

This commit is contained in:
Carlos Martín committed 2012-10-16 14:59:16 +02:00
1 parent a363381aab
commit ec4de2ed08
4 files changed
+30 -26

No files matched your search

+20 -20
View File
@@ -65,26 +65,26 @@ public:
*/
enum LcmState
{
LCM_INIT = 0,
PROLOG = 1,
BOOT = 2,
RUNNING = 3,
MIGRATE = 4,
SAVE_STOP = 5,
SAVE_SUSPEND = 6,
SAVE_MIGRATE = 7,
PROLOG_MIGRATE = 8,
PROLOG_RESUME = 9,
EPILOG_STOP = 10,
EPILOG = 11,
SHUTDOWN = 12,
CANCEL = 13,
FAILURE = 14,
CLEANUP = 15,
UNKNOWN = 16,
HOTPLUG = 17,
SHUTDOWN_POWEROFF = 18,
BOOT_UNKNOWN = 19
LCM_INIT = 0,
PROLOG = 1,
BOOT = 2,
RUNNING = 3,
MIGRATE = 4,
SAVE_STOP = 5,
SAVE_SUSPEND = 6,
SAVE_MIGRATE = 7,
PROLOG_MIGRATE = 8,
PROLOG_RESUME = 9,
EPILOG_STOP = 10,
EPILOG = 11,
SHUTDOWN = 12,
CANCEL = 13,
FAILURE = 14,
CLEANUP = 15,
UNKNOWN = 16,
HOTPLUG = 17,
SHUTDOWN_POWEROFF = 18,
BOOT_UNKNOWN = 19
};
// -------------------------------------------------------------------------
+1 -1
View File
@@ -320,7 +320,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
restart_desc = <<-EOT.unindent
Boots the given VM.
States: UNKNOWN, BOOT, POWEROFF
States: UNKNOWN, BOOT, BOOT_UNKNOWN, POWEROFF
EOT
command :restart, restart_desc, [:range,:vmid_list] do
@@ -84,7 +84,8 @@ public class VirtualMachine extends PoolElement{
"CLEANUP",
"UNKNOWN",
"HOTPLUG",
"SHUTDOWN_POWEROFF" };
"SHUTDOWN_POWEROFF",
"BOOT_UNKNOWN" };
private static final String[] SHORT_LCM_STATES =
{
@@ -106,7 +107,8 @@ public class VirtualMachine extends PoolElement{
"clea",
"unkn",
"hotp",
"poff" };
"poff",
"boot" };
/**
* Creates a new VM representation.
@@ -585,7 +587,7 @@ public class VirtualMachine extends PoolElement{
}
/**
* Forces a re-deployment of a VM in UNKNOWN or BOOT state.
* Forces a re-deployment of a VM in UNKNOWN, BOOT or BOOT_UNKNOWN state.
* @return If an error occurs the error message contains the reason.
*/
public OneResponse restart()
+4 -2
View File
@@ -43,7 +43,8 @@ module OpenNebula
LCM_STATE=%w{LCM_INIT PROLOG BOOT RUNNING MIGRATE SAVE_STOP SAVE_SUSPEND
SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME EPILOG_STOP EPILOG
SHUTDOWN CANCEL FAILURE CLEANUP UNKNOWN HOTPLUG SHUTDOWN_POWEROFF}
SHUTDOWN CANCEL FAILURE CLEANUP UNKNOWN HOTPLUG SHUTDOWN_POWEROFF
BOOT_UNKNOWN}
SHORT_VM_STATES={
"INIT" => "init",
@@ -76,6 +77,7 @@ module OpenNebula
"UNKNOWN" => "unkn",
"HOTPLUG" => "hotp",
"SHUTDOWN_POWEROFF" => "shut"
"BOOT_UNKNOWN" => "boot",
}
MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL}
@@ -221,7 +223,7 @@ module OpenNebula
action('finalize')
end
# Forces a re-deployment of a VM in UNKNOWN or BOOT state
# Forces a re-deployment of a VM in UNKNOWN, BOOT_UNKNOWN or BOOT state
def restart
action('restart')
end