diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 18561f1fc7..eaaa3051fb 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -87,7 +87,7 @@ class OpenNebulaDriver < ActionManager :ssh_stream => nil }.merge(ops) - params = parameters+" #{id} #{host}" + params = parameters + " #{id} #{host}" command = action_command_line(aname, params, options[:script_name]) if action_is_local?(aname) diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index f9f5fc1c21..8f6e998c45 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -36,6 +36,7 @@ class VirtualMachineDriver < OpenNebulaDriver ACTION = { :deploy => "DEPLOY", :shutdown => "SHUTDOWN", + :reboot => "REBOOT" :cancel => "CANCEL", :save => "SAVE", :restore => "RESTORE", @@ -80,6 +81,7 @@ class VirtualMachineDriver < OpenNebulaDriver register_action(ACTION[:deploy].to_sym, method("deploy")) register_action(ACTION[:shutdown].to_sym, method("shutdown")) + register_action(ACTION[:reboot].to_sym, method("reboot")) register_action(ACTION[:cancel].to_sym, method("cancel")) register_action(ACTION[:save].to_sym, method("save")) register_action(ACTION[:restore].to_sym, method("restore")) @@ -119,6 +121,11 @@ class VirtualMachineDriver < OpenNebulaDriver send_message(ACTION[:shutdown],RESULT[:failure],id,error) end + def reboot(id, drv_message) + error = "Action not implemented by driver #{self.class}" + send_message(ACTION[:reboot],RESULT[:failure],id,error) + end + def cancel(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:cancel],RESULT[:failure],id,error) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 4b854a697a..107ddcdd5f 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -452,9 +452,18 @@ class ExecDriver < VirtualMachineDriver def poll(id, drv_message) data = decode(drv_message) host = data.elements['HOST'].text - deploy_id = data.elements['DEPLOY_ID'].text - do_action("#{deploy_id} #{host}", id, host, ACTION[:poll]) + do_action("#{id} #{host}", id, host, ACTION[:poll]) + end + + # + # REBOOT action, reboots a running VM + # + def reboot(id, drv_message) + data = decode(drv_message) + host = data.elements['HOST'].text + + do_action("#{id} #{host}", id, host, ACTION[:reboot]) end end