Skip to content

Commit

Permalink
Merge pull request #358 from fdupont-redhat/v2v_fix_transformation_ho…
Browse files Browse the repository at this point in the history
…st_acquisition

Fix computation of currently running conversions by host
  • Loading branch information
gmcculloug authored Jul 17, 2018
2 parents a740e88 + 9a6de52 commit 5ec8138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def main
end

def self.get_runners_count_by_host(host, handle = $evm)
handle.vmdb(:service_template_transformation_plan_task).where(:state => 'active').select { |task| task.get_option(:transformation_host) == host }.size
handle.vmdb(:service_template_transformation_plan_task).where(:state => 'active').select { |task| task.get_option(:transformation_host_id) == host.id }.size
end

def self.transformation_hosts(ems, method, factory_config)
Expand All @@ -24,7 +24,7 @@ def self.transformation_hosts(ems, method, factory_config)
:host => host,
:runners => {
:current => get_runners_count_by_host(host),
:maximum => host.custom_get('Max Transformation Runners') || factory_config['transformation_host_max_runners'] || 1
:maximum => host.custom_get('Max Transformation Runners') || factory_config['transformation_host_max_runners'] || 10
}
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def main

max_runners = destination_ems.custom_get('Max Transformation Runners') || factory_config['max_transformation_runners_by_ems'] || 1
if Transformation::TransformationHosts::Common::Utils.get_runners_count_by_ems(destination_ems, @handle.get_state_var(:transformation_method), factory_config) >= max_runners
@handle.log("Too many transformations running: (#{max_runners}). Retrying.")
@handle.log(":info, Too many transformations running: (#{max_runners}). Retrying.")
else
# Collect the VMware connection information
vmware_uri = "vpx://"
Expand Down

0 comments on commit 5ec8138

Please sign in to comment.