
vsphere 6.7 通过web 客户端导出模板,只会导出ovf 模板,不能直接导出成ova格式。
部署时,浏览选择文件要将这三个文件同时选中才可以
vsphere6.7 导出ova格式的模板方法,由于直接同web client 无法直接导出,VMware 提供的ovf 工具来实现导出ova 格式的模板
下载官方工具,安装、配置环境变量
https://my.vmware.com/group/vmware/downloads/details?productId=614&downloadGroup=OVFTOOL420
将虚拟机关机,光盘挂载之类的也全部删除,找到虚拟机所在的宿主机,执行如下命令即可
ovftool.exe vi://root@192.168.12.37:443/test-80-eda-tools C:\Users\root\Desktop\CentOS_7_eda.ova
如果报下面错,可能是因为路径不对
Error: Locator does not refer to an object: vi://root@192.168.12.32:443ha-datacenter/host/localhost./Resources/Windows10-template
Completed with errors
可根据下面方式查找
C:\Users\root\Desktop>ovftool.exe vi://root@192.168.12.32:443 Windows10-template.ova
Enter login information for source vi://192.168.12.32/
Username: root
Password: ********
Opening VI source: vi://root@192.168.12.32:443/
Error: Found wrong kind of object (ResourcePool). Possible completions are:
centos-eda01
test-81-windows10
培训-bck
node03
node06
g1-2
20220426-training-1
20220426-training-2
c4-m8-1
c8-m8-1
test-117
zkxy-alps-test--3
zkxy-alps-test--12
Ubuntu Linux (64 位)
zkxy-alps-test--4
hello
djz123
windows10-template
Completed with errors
通过vcenter下载(name:password里面都可以包含用户名)
ovftool vi://name:password@hostname/ D:\
ovftool.exe vi://whq@vsphere.local:Wanghaiqing@123@192.168.12.30:443/Datacenter/vm/云平台正式环境/windows10-template d:\Windows10-template.ova
测试环境
ovftool.exe vi://administrator@vsphere.local:Password@123@172.18.0.91:443/Datacenter/vm/windows2016 C:\Users\root\Desktop\windows2016.ova
Vcenter导出ova文件Vcenter导出ova文件(未验证)
ovftool -o
--powerOffSource
--acceptAllEulas
--machineOutput
--X:logLevel=verbose
--X:logFile=log.log
--noSSLVerify
"vi://username:password@vcenter/datecenter /vm/vmName" /root/vmName.ova
参数解释
-o(--overwrite):如果导出的文件名已存在,强制重写;
--powerOffSource:确保VM在被导出之前处于关机的状态;
--machineOutput:以机器可读的格式输出ovftool的信息;
注意:
另外需要注意的一点是ovftool导出的文件权限问题,默认是600,建议改成644。
#跨vcenter版本时导出需添加参数--noNvramFile
参考
https://www.cnblogs.com/aldshengdeng/p/14445919.html
文章最后更新时间: 2022-08-06 14:51:21