diff --git a/src/cli/onevm b/src/cli/onevm index 3cd90e80ec..d94455657e 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -182,6 +182,19 @@ cmd=CommandParser::CmdParser.new(ARGV) do end end + reboot_desc = <<-EOT.unindent + Reboots the given VM, this is equivalent to execute the reboot command + from the VM console. + + States: RUNNING + EOT + + command :reboot, reboot_desc, [:range,:vmid_list] do + helper.perform_actions(args[0],options,"rebooting") do |vm| + vm.reboot + end + end + deploy_desc = <<-EOT.unindent Deploys the given VM in the specified Host. This command forces the deployment, in a standard installation the Scheduler is in charge diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index 8f6e998c45..11a419baee 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -36,7 +36,7 @@ class VirtualMachineDriver < OpenNebulaDriver ACTION = { :deploy => "DEPLOY", :shutdown => "SHUTDOWN", - :reboot => "REBOOT" + :reboot => "REBOOT", :cancel => "CANCEL", :save => "SAVE", :restore => "RESTORE", diff --git a/src/oca/ruby/OpenNebula/VirtualMachine.rb b/src/oca/ruby/OpenNebula/VirtualMachine.rb index 8e708ff9ff..1690e210c1 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachine.rb +++ b/src/oca/ruby/OpenNebula/VirtualMachine.rb @@ -143,6 +143,11 @@ module OpenNebula action('shutdown') end + # Shutdowns an already deployed VM + def reboot + action('reboot') + end + # Cancels a running VM def cancel action('cancel')