From ddb8fc1933ef3a94dd4c848a156d5c71ffb37ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 20 Mar 2013 14:46:07 +0100 Subject: [PATCH] Feature #1797: Update onevm commands in host hook --- share/etc/oned.conf | 8 ++++---- share/hooks/host_error.rb | 14 +++++++------- src/cli/onevm | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 06132ab3ea..7196bd0e63 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -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" ] #------------------------------------------------------------------------------- diff --git a/share/hooks/host_error.rb b/share/hooks/host_error.rb index 6d6dfa3fd9..15ee2b4a40 100755 --- a/share/hooks/host_error.rb +++ b/share/hooks/host_error.rb @@ -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 diff --git a/src/cli/onevm b/src/cli/onevm index 134c55ccde..0ad0f93004 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -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