VMWare Workstation 升级后 Python VIX 脚本抛出异常
Posted
技术标签:
【中文标题】VMWare Workstation 升级后 Python VIX 脚本抛出异常【英文标题】:Python VIX script throws exception after VMWare Worokstation upgrade 【发布时间】:2020-11-21 19:35:40 【问题描述】:我有一个使用了一段时间的 python VMWare 脚本。最近将我的工作站版本从 15.5.5 升级到 15.5.6 后,脚本在 python VIX 模块中引发异常:
Traceback (most recent call last):
File "C:\Python38_64\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
...more...
vm, ss = common.get_vm(params.vm_path, params.vm_snapshot)
File "D:\play\vmware\common.py", line 52, in get_vm
host = vix.VixHost()
File "C:\Python38_64\lib\site-packages\vix\VixHost.py", line 141, in __init__
raise VixError(vix.VixJob_GetError(job))
vix.VixError.VixError: VixError #22002: The specified version was not found
我卸载了新的 VMWare Workstation 版本并重新安装了 15.5.5。我的vixwrapper-config.txt
(降级后)看起来像这样:
#...more...
# will be the first used. If for some reason that value fails, it will
# continue through any other matches.
# Workstation 15.0.0
ws 19 vmdb 15.0.0 Workstation-15.0.0
player 19 vmdb 15.0.0 Workstation-15.0.0
# latest un-versioned
ws 19 vmdb e.x.p Workstation-15.0.0
player 19 vmdb e.x.p Workstation-15.0.0
# EOF
我尝试pip uinstall vix
并重新安装,但问题仍然存在。我使用的 VIX 绑定是:
pip show vix
Name: vix
Version: 1.0.7
Summary: VMware VIX binding for Python (unofficial)
Home-page: https://github.com/naim94a/vix
Author: Naim A.
Author-email: naim94a@gmail.com
License: GPLv3
Location: c:\python38_64\lib\site-packages
Requires: cffi, six
Required-by:
使用vmrun.exe start <path_to_vm>
启动虚拟机没有任何问题。
任何帮助将不胜感激。
【问题讨论】:
【参考方案1】:更改vixwrapper-config.txt
后修改行:
ws 19 vmdb e.x.p Workstation-15.0.0
player 19 vmdb e.x.p Workstation-15.0.0
到:
ws 19 vmdb 15.5.0 Workstation-15.0.0
player 19 vmdb 15.5.0 Workstation-15.0.0
它又开始工作了。
【讨论】:
以上是关于VMWare Workstation 升级后 Python VIX 脚本抛出异常的主要内容,如果未能解决你的问题,请参考以下文章
Vmware workstation 14 升级安装macOS Mojave 测试版操作系统
如何在VMWare Workstation启用UEFI来支持win10 9901