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

feature #1307: Add a new force copy in sh im driver to force probe copying

Useful for attach disk in VMware
This commit is contained in:
Tino Vazquez 2012-06-14 19:31:53 +02:00
parent 7fe0794c63
commit e63cff6e57

View File

@ -53,7 +53,7 @@ class InformationManagerDriver < OpenNebulaDriver
# Execute the run_probes in the remote host
def action_monitor(number, host, do_update)
if !action_is_local?(:MONITOR)
if !action_is_local?(:MONITOR) || @options[:force_copy]
if do_update == "1"
# Use SCP to sync:
sync_cmd = "scp -r #{@local_scripts_base_path}/. " \
@ -82,13 +82,15 @@ end
opts = GetoptLong.new(
[ '--retries', '-r', GetoptLong::OPTIONAL_ARGUMENT ],
[ '--threads', '-t', GetoptLong::OPTIONAL_ARGUMENT ],
[ '--local', '-l', GetoptLong::NO_ARGUMENT ]
[ '--local', '-l', GetoptLong::NO_ARGUMENT ],
[ '--force-copy', '-c', GetoptLong::NO_ARGUMENT ]
)
hypervisor = ''
retries = 0
threads = 15
local_actions = {}
force_copy = false
begin
opts.each do |opt, arg|
@ -99,6 +101,8 @@ begin
threads = arg.to_i
when '--local'
local_actions={ 'MONITOR' => nil }
when '--force-copy'
force_copy=true
end
end
rescue Exception => e
@ -112,6 +116,7 @@ end
im = InformationManagerDriver.new(hypervisor,
:concurrency => threads,
:retries => retries,
:local_actions => local_actions)
:local_actions => local_actions,
:force_copy => force_copy)
im.start_driver