Skip to content

Commit

Permalink
Merge pull request #19954 from fdupont-redhat/v2v_bz_1812685
Browse files Browse the repository at this point in the history
Allow overriding ESXi IP address with a custom attribute

(cherry picked from commit 920f914)

https://bugzilla.redhat.com/show_bug.cgi?id=1812685
  • Loading branch information
agrare authored and simaishi committed Mar 20, 2020
1 parent abbe10c commit 6c2e861
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/service_template_transformation_plan_task.rb
Expand Up @@ -360,7 +360,7 @@ def conversion_options_source_provider_vmwarews_vddk(_storage)
:vmware_uri => URI::Generic.build(
:scheme => 'esx',
:userinfo => CGI.escape(source.host.authentication_userid),
:host => source.host.ipaddress,
:host => source.host.miq_custom_get('TransformationIPAddress') || source.host.ipaddress,
:path => '/',
:query => { :no_verify => 1 }.to_query
).to_s,
Expand Down
26 changes: 25 additions & 1 deletion spec/models/service_template_transformation_plan_task_spec.rb
Expand Up @@ -596,7 +596,7 @@
conversion_host.vddk_transport_supported = true
end

it "generates conversion options hash" do
it "generates conversion options hash with host admin IP address" do
expect(task_1.conversion_options).to eq(
:vm_name => src_vm_1.name,
:transport_method => 'vddk',
Expand All @@ -616,6 +616,30 @@
)
end

it "generates conversion options hash with host custom IP address" do
src_host.miq_custom_set('TransformationIPAddress', '192.168.254.1')
expect(task_1.conversion_options).to eq(
:vm_name => src_vm_1.name,
:vm_uuid => src_vm_1.uid_ems,
:conversion_host_uuid => conversion_host.resource.ems_ref,
:transport_method => 'vddk',
:vmware_fingerprint => '01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef:01:23:45:67',
:vmware_uri => "esx://esx_user@192.168.254.1/?no_verify=1",
:vmware_password => 'esx_passwd',
:rhv_url => "https://#{redhat_ems.hostname}/ovirt-engine/api",
:rhv_cluster => redhat_cluster.name,
:rhv_storage => redhat_storages.first.name,
:rhv_password => redhat_ems.authentication_password,
:source_disks => [src_disk_1.filename, src_disk_2.filename],
:network_mappings => task_1.network_mappings,
:install_drivers => true,
:insecure_connection => true,
:two_phase => true,
:warm => true,
:daemonize => false
)
end

it_behaves_like "#run_conversion"
end

Expand Down

0 comments on commit 6c2e861

Please sign in to comment.