diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index bf6aeb8ff5..b46bdff6f5 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -98,7 +98,9 @@ class OpenNebulaDriver < ActionManager params = "#{params} #{id} #{host}" unless options[:no_extra_params] command = action_command_line(aname, params, options[:script_name]) - if action_is_local?(aname) + # if options[:is_local] is not specified (nil) + # we rely uniquely in actions_is_local? + if action_is_local?(aname) or options[:is_local] stdin = Base64.strict_encode64(options[:stdin].to_s) execution = LocalCommand.run(command, log_method(id), diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 61d14cf4ae..7b7d1e085a 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -235,7 +235,8 @@ class VmmAction :ssh_stream => ssh, :respond => false, :stdin => stdin, - :no_extra_params => no_extra_params) + :no_extra_params => no_extra_params, + :is_local => step[:is_local]) when :vnm if step[:destination] vnm = @vnm_dst @@ -386,7 +387,9 @@ class ExecDriver < VirtualMachineDriver domain = File.read(local_dfile) - if action_is_local?(:deploy) + is_action_local = action_is_local?(:deploy) + + if is_action_local dfile = action.data[:local_dfile] else dfile = action.data[:remote_dfile] @@ -410,7 +413,7 @@ class ExecDriver < VirtualMachineDriver } end - vm_dir=File.dirname(action.data[:remote_dfile]) + vm_dir=File.dirname(dfile) steps.concat([ # Execute pre-boot networking setup @@ -421,19 +424,24 @@ class ExecDriver < VirtualMachineDriver # Make vm_dir, store vm.xml and ds.xml { - :driver => :vmm, - :action => "/bin/mkdir -p", - :parameters => [vm_dir] + :driver => :vmm, + :action => "/bin/mkdir -p", + :is_local => is_action_local, + :stdin => "", + :no_extra_params => true, + :parameters => [vm_dir] }, { - :driver => :vmm, - :action => "/bin/cat - >#{vm_dir}/vm.xml", - :stdin => xml_data.elements['VM'].to_s, + :driver => :vmm, + :action => "/bin/cat - >#{vm_dir}/vm.xml", + :is_local => is_action_local, + :stdin => xml_data.elements['VM'].to_s, :no_extra_params => true }, { :driver => :vmm, :action => "/bin/cat - >#{vm_dir}/ds.xml", + :is_local => is_action_local, :stdin => xml_data.elements['DATASTORE'].to_s, :no_extra_params => true },