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

M #-: Fix for local steps in vCenter

This commit is contained in:
Tino Vazquez 2020-11-06 10:23:09 +01:00
parent e58eae6c66
commit aa78acf67e
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 20 additions and 10 deletions

View File

@ -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),

View File

@ -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
},