Skip to content

Commit 4f934ff

Browse files
authored
Merge pull request #6489 from mxie91/add-esx-uri-for-v2v-to-libvirt-job
Add esx uri for v2v to libvirt jobs
2 parents e565f38 + e8e7151 commit 4f934ff

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

v2v/tests/cfg/convert_vm_to_libvirt.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
# Set the real vddk_libdir/thumbprint or keep it commented
2626
#vddk_libdir = VDDK_LIB_DIR_EXAMPLE
2727
#vddk_thumbprint = VDDK_THUMBPRINT_EXAMPLE
28+
variants:
29+
- vpx_uri:
30+
- esx_uri:
31+
src_uri_type = 'esx'
2832
- it_default:
2933
variants:
3034
- arch_i386:

v2v/tests/src/convert_vm_to_libvirt.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def run(test, params, env):
3737
vpx_pwd_file = params.get("vpx_passwd_file")
3838
vpx_dc = params.get("vpx_dc")
3939
esx_ip = params.get("esx_hostname")
40+
esxi_password = params.get('esxi_password')
41+
src_uri_type = params.get('src_uri_type')
4042
hypervisor = params.get("hypervisor")
4143
input_mode = params.get("input_mode")
4244
target = params.get("target")
@@ -58,10 +60,10 @@ def run(test, params, env):
5860

5961
if hypervisor == "esx":
6062
source_ip = vpx_ip
61-
source_pwd = vpx_pwd
63+
source_pwd = vpx_pwd if src_uri_type != 'esx' else esxi_password
6264
# Create password file to access ESX hypervisor
6365
with open(vpx_pwd_file, 'w') as f:
64-
f.write(vpx_pwd)
66+
f.write(source_pwd)
6567
elif hypervisor == "xen":
6668
source_ip = xen_ip
6769
source_pwd = xen_pwd
@@ -80,6 +82,8 @@ def run(test, params, env):
8082

8183
# Create libvirt URI for the source node
8284
v2v_uri = utils_v2v.Uri(hypervisor)
85+
if src_uri_type == 'esx':
86+
vpx_dc = None
8387
remote_uri = v2v_uri.get_uri(source_ip, vpx_dc, esx_ip)
8488
LOG.debug("Remote host uri for converting: %s", remote_uri)
8589

@@ -124,6 +128,8 @@ def run(test, params, env):
124128
'vddk_thumbprint': vddk_thumbprint,
125129
'vddk_libdir': vddk_libdir,
126130
'vddk_libdir_src': vddk_libdir_src,
131+
'esxi_password': esxi_password,
132+
'src_uri_type': src_uri_type,
127133
'params': params
128134
}
129135
if vpx_dc:

0 commit comments

Comments
 (0)