Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-libvirt
提交
fc60b9da
T
tp-libvirt
项目概览
openeuler
/
tp-libvirt
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
fc60b9da
编写于
8月 12, 2020
作者:
C
chunfu wen
提交者:
GitHub
8月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2961 from xiaodwan/v2v_code_improvement
v2v: improve codes and add new -o json cases
上级
6c38f3a2
f61dcc08
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
191 addition
and
59 deletion
+191
-59
provider/v2v_vmcheck_helper.py
provider/v2v_vmcheck_helper.py
+91
-1
v2v/tests/cfg/convert_from_file.cfg
v2v/tests/cfg/convert_from_file.cfg
+1
-3
v2v/tests/cfg/function_test_esx.cfg
v2v/tests/cfg/function_test_esx.cfg
+9
-0
v2v/tests/cfg/specific_kvm.cfg
v2v/tests/cfg/specific_kvm.cfg
+1
-3
v2v/tests/cfg/v2v_options.cfg
v2v/tests/cfg/v2v_options.cfg
+1
-2
v2v/tests/src/convert_from_file.py
v2v/tests/src/convert_from_file.py
+24
-8
v2v/tests/src/convert_vm_to_libvirt.py
v2v/tests/src/convert_vm_to_libvirt.py
+1
-1
v2v/tests/src/convert_vm_to_ovirt.py
v2v/tests/src/convert_vm_to_ovirt.py
+4
-4
v2v/tests/src/function_test_esx.py
v2v/tests/src/function_test_esx.py
+46
-27
v2v/tests/src/function_test_xen.py
v2v/tests/src/function_test_xen.py
+7
-5
v2v/tests/src/specific_kvm.py
v2v/tests/src/specific_kvm.py
+6
-5
未找到文件。
provider/v2v_vmcheck_helper.py
浏览文件 @
fc60b9da
import
os
import
re
import
logging
import
time
import
json
import
string
import
logging
from
distutils.version
import
LooseVersion
# pylint: disable=E0611
from
avocado.core
import
exceptions
...
...
@@ -765,3 +767,91 @@ class VMChecker(object):
elif
has_genid
==
'no'
:
if
re
.
search
(
r
'genid'
,
self
.
vmxml
):
self
.
log_err
(
'Unexpected genid in xml'
)
def
check_local_output
(
params
):
"""
Check -o local result
Only do basic checking, '-o libvirt' already does
the whole checking process.
"""
logging
.
info
(
'checking local output'
)
os_directory
=
params
.
get
(
'os_directory'
)
disk_count
=
int
(
params
.
get
(
'vm_disk_count'
,
0
))
vm_name
=
params
.
get
(
'main_vm'
)
result
=
True
# Checking all disks
for
i
,
c
in
enumerate
(
string
.
ascii_lowercase
):
if
i
==
disk_count
:
break
disk_file_name
=
"%s-%s"
%
(
vm_name
,
'sd%s'
%
c
)
disk_file
=
os
.
path
.
join
(
os_directory
,
disk_file_name
)
if
not
os
.
path
.
isfile
(
disk_file
):
logging
.
error
(
'Not found %s'
%
disk_file
)
result
=
False
# Check json file
xml_file
=
os
.
path
.
join
(
os_directory
,
'%s.xml'
%
vm_name
)
if
not
os
.
path
.
isfile
(
xml_file
):
logging
.
error
(
'Not found %s'
%
xml_file
)
result
=
False
return
result
def
check_json_output
(
params
):
"""
Check -o json result
"""
logging
.
info
(
'checking json output'
)
os_directory
=
params
.
get
(
'os_directory'
)
disk_count
=
int
(
params
.
get
(
'vm_disk_count'
,
0
))
vm_name
=
params
.
get
(
'main_vm'
)
json_disk_pattern
=
params
.
get
(
'json_disk_pattern'
)
result
=
True
json_disk_dict
=
{
'GuestName'
:
vm_name
,
'DiskDeviceName'
:
''
,
'DiskNo'
:
0
}
if
json_disk_pattern
:
json_disk_pattern
=
json_disk_pattern
.
replace
(
'%{'
,
'{'
)
json_disk_pattern
=
re
.
sub
(
r
'%{(.*?)}'
,
r
'%%{{\g<1>}}'
,
json_disk_pattern
)
# Checking all disks
for
i
,
c
in
enumerate
(
string
.
ascii_lowercase
):
if
i
==
disk_count
:
break
json_disk_dict
.
update
({
'DiskDeviceName'
:
'sd%s'
%
c
})
json_disk_dict
.
update
({
'DiskNo'
:
'%d'
%
(
i
+
1
)})
disk_file_name
=
"%s-%s"
%
(
vm_name
,
'sd%s'
%
c
)
if
json_disk_pattern
:
disk_file_name
=
json_disk_pattern
.
format
(
**
json_disk_dict
)
disk_file
=
os
.
path
.
join
(
os_directory
,
disk_file_name
)
if
not
os
.
path
.
isfile
(
disk_file
):
logging
.
error
(
'Not found %s'
%
disk_file
)
result
=
False
# Check json file
json_file
=
os
.
path
.
join
(
os_directory
,
'%s.json'
%
vm_name
)
if
not
os
.
path
.
isfile
(
json_file
):
logging
.
error
(
'Not found %s'
%
json_file
)
result
=
False
# Check content of the json file
with
open
(
json_file
)
as
fp
:
vm
=
json
.
load
(
fp
)
if
vm
[
'name'
]
!=
vm_name
and
len
(
vm
[
'disks'
])
!=
disk_count
:
logging
.
error
(
'Verify content failed in %s'
%
json_file
)
result
=
False
return
result
v2v/tests/cfg/convert_from_file.cfg
浏览文件 @
fc60b9da
...
...
@@ -37,9 +37,7 @@
- rhv:
output_method = "rhev"
- local:
only dest_none
output_mode = local
target = ${output_mode}
only dest_local
variants:
- input_mode:
variants:
...
...
v2v/tests/cfg/function_test_esx.cfg
浏览文件 @
fc60b9da
...
...
@@ -36,6 +36,13 @@
src_uri_type = 'esx'
- it_default:
variants:
- json:
only dest_json
only uefi.win2019,device_map
variants:
- default:
- pattern:
json_disk_pattern = '%%{GuestName}-%{GuestName}-%{DiskDeviceName}-%{DiskNo}'
- libvirt:
only dest_libvirt
only uefi, GPO_AV, special_name, suse
...
...
@@ -233,6 +240,8 @@
only esx_60
main_vm = VM_NAME_EMPTY_CDROM_V2V_EXAMPLE
checkpoint = empty_cdrom
skip_vm_check = yes
skip_reason = "No vm is created in this case"
- option_root:
only esx_67
main_vm = VM_NAME_MULTIPLE_LINUX_V2V_EXAMPLE
...
...
v2v/tests/cfg/specific_kvm.cfg
浏览文件 @
fc60b9da
...
...
@@ -32,9 +32,7 @@
- output_mode:
variants:
- local:
only dest_none
output_mode = 'local'
target = ${output_mode}
only dest_local
- rhev:
only dest_rhev.NFS
variants:
...
...
v2v/tests/cfg/v2v_options.cfg
浏览文件 @
fc60b9da
...
...
@@ -26,8 +26,7 @@
only dest_libvirt
target = "libvirt"
- local:
only dest_none
output_mode = "local"
only dest_local
output_storage = "/tmp"
- null:
only dest_null
...
...
v2v/tests/src/convert_from_file.py
浏览文件 @
fc60b9da
...
...
@@ -15,6 +15,8 @@ from virttest import remote
from
virttest.utils_test
import
libvirt
from
provider.v2v_vmcheck_helper
import
VMChecker
from
provider.v2v_vmcheck_helper
import
check_json_output
from
provider.v2v_vmcheck_helper
import
check_local_output
def
run
(
test
,
params
,
env
):
...
...
@@ -34,7 +36,7 @@ def run(test, params, env):
input_file
=
params
.
get
(
'input_file'
)
output_mode
=
params
.
get
(
'output_mode'
)
output_format
=
params
.
get
(
'output_format'
)
output_storage
=
params
.
get
(
'output_storage'
,
'default'
)
o
s_pool
=
o
utput_storage
=
params
.
get
(
'output_storage'
,
'default'
)
bridge
=
params
.
get
(
'bridge'
)
network
=
params
.
get
(
'network'
)
address_cache
=
env
.
get
(
'address_cache'
)
...
...
@@ -122,9 +124,17 @@ def run(test, params, env):
"""
Check virt-v2v command result
"""
libvirt
.
check_exit_status
(
result
,
status_error
)
output
=
result
.
stdout_text
+
result
.
stderr_text
if
not
status_error
:
def
vm_check
():
"""
Checking the VM
"""
if
output_mode
==
'json'
and
not
check_json_output
(
params
):
test
.
fail
(
'check json output failed'
)
if
output_mode
==
'local'
and
not
check_local_output
(
params
):
test
.
fail
(
'check local output failed'
)
if
output_mode
in
[
'null'
,
'json'
,
'local'
]:
return
# Create vmchecker before virsh.start so that the vm can be undefined
# if started failed.
vmchecker
=
VMChecker
(
test
,
params
,
env
)
...
...
@@ -148,6 +158,11 @@ def run(test, params, env):
check_BSOD
()
# Merge 2 error lists
error_list
.
extend
(
vmchecker
.
errors
)
libvirt
.
check_exit_status
(
result
,
status_error
)
output
=
result
.
stdout_text
+
result
.
stderr_text
if
not
status_error
:
vm_check
()
log_check
=
utils_v2v
.
check_log
(
params
,
output
)
if
log_check
:
log_fail
(
log_check
)
...
...
@@ -159,7 +174,7 @@ def run(test, params, env):
try
:
v2v_params
=
{
'main_vm'
:
vm_name
,
'target'
:
target
,
'v2v_opts'
:
v2v_opts
,
'storage'
:
output_storage
,
'network'
:
network
,
'bridge'
:
bridge
,
'
os_
storage'
:
output_storage
,
'network'
:
network
,
'bridge'
:
bridge
,
'input_mode'
:
input_mode
,
'input_file'
:
input_file
,
'new_name'
:
'ova_vm_'
+
utils_misc
.
generate_random_string
(
3
),
'datastore'
:
datastore
,
...
...
@@ -168,7 +183,8 @@ def run(test, params, env):
'input_transport'
:
input_transport
,
'vmx_nfs_src'
:
vmx_nfs_src
,
'output_method'
:
output_method
,
'storage_name'
:
storage_name
,
'os_storage_name'
:
storage_name
,
'os_pool'
:
os_pool
,
'rhv_upload_opts'
:
rhv_upload_opts
,
'params'
:
params
}
...
...
@@ -190,7 +206,7 @@ def run(test, params, env):
else
:
logging
.
debug
(
'%s already exists, Skip copying'
%
dest_dir
)
if
output_format
:
v2v_params
.
update
({
'o
utput
_format'
:
output_format
})
v2v_params
.
update
({
'o
f
_format'
:
output_format
})
# Create libvirt dir pool
if
output_mode
==
'libvirt'
:
pvt
.
pre_pool
(
pool_name
,
pool_type
,
pool_target
,
''
)
...
...
@@ -205,7 +221,7 @@ def run(test, params, env):
v2v_sasl
.
server_pwd
=
params
.
get
(
'remote_pwd'
)
v2v_sasl
.
setup
(
remote
=
True
)
if
output_mode
==
'local'
:
v2v_params
[
'
storage
'
]
=
data_dir
.
get_tmp_dir
()
v2v_params
[
'
os_directory
'
]
=
data_dir
.
get_tmp_dir
()
if
checkpoint
==
'ova_relative_path'
:
logging
.
debug
(
'Current dir: %s'
,
os
.
getcwd
())
...
...
v2v/tests/src/convert_vm_to_libvirt.py
浏览文件 @
fc60b9da
...
...
@@ -116,7 +116,7 @@ def run(test, params, env):
v2v_params
=
{
'target'
:
target
,
'hypervisor'
:
hypervisor
,
'main_vm'
:
vm_name
,
'input_mode'
:
input_mode
,
'network'
:
network
,
'bridge'
:
bridge
,
'
storage
'
:
pool_name
,
'hostname'
:
source_ip
,
'
os_pool
'
:
pool_name
,
'hostname'
:
source_ip
,
'password'
:
source_pwd
,
'input_transport'
:
input_transport
,
'vcenter_host'
:
vpx_ip
,
'vcenter_password'
:
vpx_pwd
,
...
...
v2v/tests/src/convert_vm_to_ovirt.py
浏览文件 @
fc60b9da
...
...
@@ -30,7 +30,7 @@ def run(test, params, env):
# nfs mount source
vddk_libdir_src
=
params
.
get
(
'vddk_libdir_src'
)
vddk_thumbprint
=
params
.
get
(
'vddk_thumbprint'
)
storage
=
params
.
get
(
'storage'
)
os_pool
=
storage
=
params
.
get
(
'storage'
)
storage_name
=
params
.
get
(
'storage_name'
)
network
=
params
.
get
(
'network'
)
bridge
=
params
.
get
(
'bridge'
)
...
...
@@ -143,11 +143,11 @@ def run(test, params, env):
v2v_params
=
{
'target'
:
target
,
'hypervisor'
:
hypervisor
,
'main_vm'
:
vm_name
,
'input_mode'
:
input_mode
,
'network'
:
network
,
'bridge'
:
bridge
,
'storage'
:
storage
,
'hostname'
:
source_ip
,
'
os_
storage'
:
storage
,
'hostname'
:
source_ip
,
# For virsh connection
'password'
:
source_pwd
,
'new_name'
:
vm_name
+
utils_misc
.
generate_random_string
(
3
),
'output_method'
:
output_method
,
'storage_name'
:
storage_name
,
'output_method'
:
output_method
,
'
os_
storage_name'
:
storage_name
,
'input_transport'
:
input_transport
,
'vcenter_host'
:
vpx_ip
,
'vcenter_password'
:
vpx_pwd
,
'vddk_thumbprint'
:
vddk_thumbprint
,
...
...
@@ -166,7 +166,7 @@ def run(test, params, env):
output_format
=
params
.
get
(
'output_format'
)
# output_format will be set to 'raw' in utils_v2v.v2v_cmd if it's None
if
output_format
:
v2v_params
.
update
({
'o
utput
_format'
:
output_format
})
v2v_params
.
update
({
'o
f
_format'
:
output_format
})
# Set libguestfs environment variable
if
hypervisor
in
(
'xen'
,
'kvm'
):
...
...
v2v/tests/src/function_test_esx.py
浏览文件 @
fc60b9da
...
...
@@ -15,6 +15,8 @@ from avocado.utils import download
from
aexpect.exceptions
import
ShellProcessTerminatedError
from
provider.v2v_vmcheck_helper
import
VMChecker
from
provider.v2v_vmcheck_helper
import
check_json_output
from
provider.v2v_vmcheck_helper
import
check_local_output
def
run
(
test
,
params
,
env
):
...
...
@@ -58,10 +60,12 @@ def run(test, params, env):
vddk_thumbprint
=
params
.
get
(
'vddk_thumbprint'
)
src_uri_type
=
params
.
get
(
'src_uri_type'
)
esxi_password
=
params
.
get
(
'esxi_password'
)
json_disk_pattern
=
params
.
get
(
'json_disk_pattern'
)
# For construct rhv-upload option in v2v cmd
output_method
=
params
.
get
(
"output_method"
)
rhv_upload_opts
=
params
.
get
(
"rhv_upload_opts"
)
storage_name
=
params
.
get
(
'storage_name'
)
os_pool
=
os_storage
=
params
.
get
(
'output_storage'
,
'default'
)
# for get ca.crt file from ovirt engine
rhv_passwd
=
params
.
get
(
"rhv_upload_passwd"
)
rhv_passwd_file
=
params
.
get
(
"rhv_upload_passwd_file"
)
...
...
@@ -412,12 +416,20 @@ def run(test, params, env):
"""
Check virt-v2v command result
"""
libvirt
.
check_exit_status
(
result
,
status_error
)
output
=
result
.
stdout_text
+
result
.
stderr_text
if
checkpoint
==
'empty_cdrom'
:
def
vm_check
(
status_error
):
"""
Checking the VM
"""
if
status_error
:
log_fail
(
'Virsh dumpxml failed for empty cdrom image'
)
elif
not
status_error
:
return
if
output_mode
==
'json'
and
not
check_json_output
(
params
):
test
.
fail
(
'check json output failed'
)
if
output_mode
==
'local'
and
not
check_local_output
(
params
):
test
.
fail
(
'check local output failed'
)
if
output_mode
in
[
'null'
,
'json'
,
'local'
]:
return
vmchecker
=
VMChecker
(
test
,
params
,
env
)
params
[
'vmchecker'
]
=
vmchecker
if
output_mode
==
'rhev'
:
...
...
@@ -428,25 +440,20 @@ def run(test, params, env):
virsh
.
start
(
vm_name
,
debug
=
True
)
# Check guest following the checkpoint document after convertion
logging
.
info
(
'Checking common checkpoints for v2v'
)
if
skip_vm_check
!=
'yes'
:
if
checkpoint
==
'ogac'
:
# windows guests will reboot at any time after qemu-ga is
# installed. The process cannot be controled. In order to
# don't break vmchecker.run() process, It's better to put
# check_windows_ogac before vmchecker.run(). Because in
# check_windows_ogac, it waits until rebooting completes.
vmchecker
.
checker
.
create_session
()
if
os_type
==
'windows'
:
check_windows_ogac
(
vmchecker
.
checker
)
else
:
check_linux_ogac
(
vmchecker
.
checker
)
ret
=
vmchecker
.
run
()
if
len
(
ret
)
==
0
:
logging
.
info
(
"All common checkpoints passed"
)
else
:
logging
.
info
(
'Skip checking vm after conversion: %s'
%
skip_reason
)
if
checkpoint
==
'ogac'
:
# windows guests will reboot at any time after qemu-ga is
# installed. The process cannot be controled. In order to
# don't break vmchecker.run() process, It's better to put
# check_windows_ogac before vmchecker.run(). Because in
# check_windows_ogac, it waits until rebooting completes.
vmchecker
.
checker
.
create_session
()
if
os_type
==
'windows'
:
check_windows_ogac
(
vmchecker
.
checker
)
else
:
check_linux_ogac
(
vmchecker
.
checker
)
ret
=
vmchecker
.
run
()
if
len
(
ret
)
==
0
:
logging
.
info
(
"All common checkpoints passed"
)
# Check specific checkpoints
if
checkpoint
==
'cdrom'
:
virsh_session
=
utils_sasl
.
VirshSessionSASL
(
params
)
...
...
@@ -472,6 +479,16 @@ def run(test, params, env):
log_fail
(
"Bridge virbr0 already started during conversion"
)
# Merge 2 error lists
error_list
.
extend
(
vmchecker
.
errors
)
libvirt
.
check_exit_status
(
result
,
status_error
)
output
=
result
.
stdout_text
+
result
.
stderr_text
if
skip_vm_check
!=
'yes'
:
vm_check
(
status_error
)
else
:
logging
.
info
(
'Skip checking vm after conversion: %s'
%
skip_reason
)
log_check
=
utils_v2v
.
check_log
(
params
,
output
)
if
log_check
:
log_fail
(
log_check
)
...
...
@@ -489,7 +506,8 @@ def run(test, params, env):
'vpx_dc'
:
vpx_dc
,
'esx_ip'
:
esx_ip
,
'new_name'
:
vm_name
+
utils_misc
.
generate_random_string
(
4
),
'v2v_opts'
:
v2v_opts
,
'input_mode'
:
'libvirt'
,
'storage'
:
params
.
get
(
'output_storage'
,
'default'
),
'os_storage'
:
os_storage
,
'os_pool'
:
os_pool
,
'network'
:
params
.
get
(
'network'
),
'bridge'
:
params
.
get
(
'bridge'
),
'target'
:
params
.
get
(
'target'
),
...
...
@@ -504,8 +522,9 @@ def run(test, params, env):
'esxi_password'
:
esxi_password
,
'esxi_host'
:
esxi_host
,
'output_method'
:
output_method
,
'storage_name'
:
storage_name
,
'
os_
storage_name'
:
storage_name
,
'rhv_upload_opts'
:
rhv_upload_opts
,
'oo_json_disk_pattern'
:
json_disk_pattern
,
'params'
:
params
}
...
...
@@ -523,7 +542,7 @@ def run(test, params, env):
v2v_params
[
'v2v_opts'
]
+=
" -ip %s"
%
vpx_passwd_file
if
params
.
get
(
'output_format'
):
v2v_params
.
update
({
'o
utput
_format'
:
params
[
'output_format'
]})
v2v_params
.
update
({
'o
f
_format'
:
params
[
'output_format'
]})
# Rename guest with special name while converting to rhev
if
'#'
in
vm_name
and
output_mode
==
'rhev'
:
v2v_params
[
'new_name'
]
=
v2v_params
[
'new_name'
].
replace
(
'#'
,
'_'
)
...
...
v2v/tests/src/function_test_xen.py
浏览文件 @
fc60b9da
...
...
@@ -54,6 +54,7 @@ def run(test, params, env):
output_method
=
params
.
get
(
"output_method"
)
rhv_upload_opts
=
params
.
get
(
"rhv_upload_opts"
)
storage_name
=
params
.
get
(
'storage_name'
)
os_pool
=
os_storage
=
params
.
get
(
'output_storage'
,
'default'
)
# for get ca.crt file from ovirt engine
rhv_passwd
=
params
.
get
(
"rhv_upload_passwd"
)
rhv_passwd_file
=
params
.
get
(
"rhv_upload_passwd_file"
)
...
...
@@ -230,12 +231,13 @@ def run(test, params, env):
'v2v_opts'
:
v2v_opts
,
'input_mode'
:
'libvirt'
,
'new_name'
:
new_vm_name
,
'password'
:
xen_host_passwd
,
'storage'
:
params
.
get
(
'output_storage'
,
'default'
),
'os_pool'
:
os_pool
,
'os_storage'
:
os_storage
,
'os_storage_name'
:
storage_name
,
'network'
:
params
.
get
(
'network'
),
'bridge'
:
params
.
get
(
'bridge'
),
'target'
:
params
.
get
(
'target'
),
'output_method'
:
output_method
,
'storage_name'
:
storage_name
,
'rhv_upload_opts'
:
rhv_upload_opts
,
'params'
:
params
}
...
...
@@ -257,12 +259,12 @@ def run(test, params, env):
utils_misc
.
add_identities_into_ssh_agent
()
if
params
.
get
(
'output_format'
):
v2v_params
.
update
({
'o
utput
_format'
:
params
.
get
(
'output_format'
)})
v2v_params
.
update
({
'o
f
_format'
:
params
.
get
(
'output_format'
)})
# Build rhev related options
if
output_mode
==
'rhev'
:
# To RHV doesn't support 'qcow2' right now
v2v_params
[
'o
utput
_format'
]
=
'raw'
v2v_params
[
'o
f
_format'
]
=
'raw'
# create different sasl_user name for different job
params
.
update
({
'sasl_user'
:
params
.
get
(
"sasl_user"
)
+
utils_misc
.
generate_random_string
(
3
)})
...
...
@@ -331,7 +333,7 @@ def run(test, params, env):
if
checkpoint
==
'pool_uuid'
:
virsh
.
pool_start
(
pool_name
)
pooluuid
=
virsh
.
pool_uuid
(
pool_name
).
stdout
.
strip
()
v2v_params
[
'
storage
'
]
=
pooluuid
v2v_params
[
'
os_pool
'
]
=
pooluuid
if
checkpoint
.
startswith
(
'vnc'
):
vm_xml
.
VMXML
.
set_graphics_attr
(
vm_name
,
{
'type'
:
'vnc'
},
virsh_instance
=
virsh_instance
)
...
...
v2v/tests/src/specific_kvm.py
浏览文件 @
fc60b9da
...
...
@@ -40,7 +40,7 @@ def run(test, params, env):
output_mode
=
params
.
get
(
'output_mode'
)
output_format
=
params
.
get
(
'output_format'
)
source_user
=
params
.
get
(
"username"
,
"root"
)
storage
=
params
.
get
(
'output_storage'
)
os_pool
=
storage
=
params
.
get
(
'output_storage'
)
bridge
=
params
.
get
(
'bridge'
)
network
=
params
.
get
(
'network'
)
ntp_server
=
params
.
get
(
'ntp_server'
)
...
...
@@ -665,13 +665,14 @@ def run(test, params, env):
'input_mode'
:
input_mode
,
'network'
:
network
,
'bridge'
:
bridge
,
'storage'
:
storage
,
'os_storage'
:
storage
,
'os_pool'
:
os_pool
,
'hostname'
:
source_ip
,
'password'
:
source_pwd
,
'v2v_opts'
:
v2v_opts
,
'new_name'
:
vm_name
+
utils_misc
.
generate_random_string
(
3
),
'output_method'
:
output_method
,
'storage_name'
:
storage_name
,
'
os_
storage_name'
:
storage_name
,
'rhv_upload_opts'
:
rhv_upload_opts
,
'input_transport'
:
input_transport
,
'vcenter_host'
:
source_ip
,
...
...
@@ -687,7 +688,7 @@ def run(test, params, env):
v2v_params
.
update
({
"esx_ip"
:
esx_ip
})
output_format
=
params
.
get
(
'output_format'
)
if
output_format
:
v2v_params
.
update
({
'o
utput
_format'
:
output_format
})
v2v_params
.
update
({
'o
f
_format'
:
output_format
})
# Build rhev related options
if
output_mode
==
'rhev'
:
# Create different sasl_user name for different job
...
...
@@ -714,7 +715,7 @@ def run(test, params, env):
ovirt_ca_file_path
,
local_ca_file_path
)
if
output_mode
==
'local'
:
v2v_params
[
'
storage
'
]
=
data_dir
.
get_tmp_dir
()
v2v_params
[
'
os_directory
'
]
=
data_dir
.
get_tmp_dir
()
if
output_mode
==
'libvirt'
:
pvt
.
pre_pool
(
pool_name
,
pool_type
,
pool_target
,
''
)
# Set libguestfs environment variable
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录