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

Feature #1797: Update onevm commands in host hook

This commit is contained in:
Carlos Martín 2013-03-20 14:46:07 +01:00
parent fd4c454a91
commit ddb8fc1933
3 changed files with 13 additions and 13 deletions

View File

@ -423,7 +423,7 @@ HM_MAD = [
# This hook is used to perform recovery actions when a host fails.
# Script to implement host failure tolerance
# It can be set to
# -r resubmit VMs running in the host
# -r recreate VMs running in the host
# -d delete VMs running in the host
# Additional flags
# -f force resubmission of suspended VMs
@ -449,13 +449,13 @@ HM_MAD = [
#VM_HOOK = [
# name = "on_failure_delete",
# on = "FAILED",
# command = "/usr/bin/env onevm delete",
# command = "/usr/bin/env onevm destroy",
# arguments = "$ID" ]
#
#VM_HOOK = [
# name = "on_failure_resubmit",
# name = "on_failure_recreate",
# on = "FAILED",
# command = "/usr/bin/env onevm resubmit",
# command = "/usr/bin/env onevm destroy --recreate",
# arguments = "$ID" ]
#-------------------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
####################################################
# Script to implement host failure tolerance
# It can be set to
# -r resubmit VMs running in the host
# -r recreate VMs running in the host
# -d delete VMs running in the host
# Additional flags
# -f force resubmission of suspended VMs
@ -50,13 +50,13 @@ if !(host_id=ARGV[0])
exit -1
end
mode = "-r" # By default, resubmit VMs
force = "n" # By default, don't resubmit/finalize suspended VMs
mode = "-r" # By default, recreate VMs
force = "n" # By default, don't recreate/destroy suspended VMs
repeat = nil # By default, don't wait fo monitorization cycles"
opts = GetoptLong.new(
['--delete', '-d',GetoptLong::NO_ARGUMENT],
['--resubmit', '-r',GetoptLong::NO_ARGUMENT],
['--recreate', '-r',GetoptLong::NO_ARGUMENT],
['--force', '-f',GetoptLong::NO_ARGUMENT],
['--pause', '-p',GetoptLong::REQUIRED_ARGUMENT]
)
@ -66,7 +66,7 @@ begin
case opt
when '--delete'
mode="-d"
when '--resubmit'
when '--recreate'
mode="-r"
when '--force'
force = "y"
@ -121,9 +121,9 @@ if vm_ids_array
vm.info
if mode == "-r"
vm.resubmit
vm.destroy(true)
elsif mode == "-d"
vm.finalize
vm.destroy
end
end
end

View File

@ -268,7 +268,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Sets the specified VM disk to be saved in a new Image. The Image is
created immediately, but the contents are saved only if the VM is
shut down gracefully (i.e., using 'onevm shutdown' and not
'onevm delete')
'onevm destroy')
If '--live' is specified, the Image will be saved immediately.
@ -321,7 +321,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
poweroff_desc = <<-EOT.unindent
Powers off the given VM. The VM will remain in the poweroff state, and
can be powered on with the 'onevm restart' command.
can be powered on with the 'onevm boot' command.
States: RUNNING
EOT