将 qcow2 转换为 vmdk 并使其兼容 ESXi 6.0 [英] Convert qcow2 to vmdk and make it ESXi 6.0 Compatible

查看:22
本文介绍了将 qcow2 转换为 vmdk 并使其兼容 ESXi 6.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在研究 VMWare 虚拟化;我正在尝试使用 ESXi Server 6.0 制作从 qcow2 到 vmdk 的转换图像.

I am currently working on VMWare virtualization; I am trying to make a converted image from qcow2 to vmdk work with ESXi Server 6.0.

我的 myImage.qcow2 有一个精简配置为 300GB 的磁盘.

I have myImage.qcow2 with a disk which is thin provisioned for 300GB.

我使用图像转换器工具 qemu 和以下命令

I used the image converter tool qemu with the following command

qemu-img convert -f qcow2 myImage.qcow2 -O vmdk myNewImage.vmdk 

此命令为我提供了一个仅与 VMWare Workstation 兼容的 vmdk 映像.因此,为了使其与 ESXi 兼容,我必须通过以下命令使用 vmkfstools.

This command gives me a vmdk image which is only VMWare Workstation compatible. Therefore, in order to make it ESXi compatible I have to use the vmkfstools with the following command.

vmkfstools -i myImage.vmdk outputName.vmdk -d thin

vmkfstools 命令给了我两个文件,一个 metadata.vmdk 和实际的 data.vmdk.

The vmkfstools command gives me two files, an metadata.vmdk and the actual data.vmdk.

如上所述,我的磁盘精简配置为 300GB,当我应用 vmkfstools 时,它会扩展磁盘并为我提供 300GB 的大小.

As mentioned above my disk is thin provisioned for 300GB and when I apply vmkfstools it expands the disk and gives me a size of 300GB.

通过 vSphere Client 部署镜像没有任何问题;但是,出于这个项目的目的,我想使用 ovftool,并且使用如此大的图像这样做是不可行的.

Deploying the image through the vSphere Client works without any problem; however, for the purpose of this project I want to use the ovftool and doing so with such a large image is not feasible.

有没有办法让我的 .vmdk ESXi 兼容而无需 vmkfstools 将我的图像扩展到 300GB?

Is there a way for me to make my .vmdk ESXi compatible without vmkfstools expanding my image to 300GB?

或者有没有其他方法可以让我在磁盘映像位于数据存储上时使用 ovftool 部署那 300GB,这样就不必通过部署过程下载/上传它?

Or Is there any other method for me to deploy those 300GB using the ovftool while the disk image is on the datastore, so that it doesn't have to be downloaded/uploaded through the deployment process?

我已经坚持了几个星期,任何帮助将不胜感激.

I have been stuck on this for weeks and any help will be highly appreciated.

推荐答案

仅供参考:此支持已根据变更日志添加到 Qemu 2.1 及更高版本中

FYI: This support has been added in Qemu 2.1 and above as per changelogs

qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 SC-1.qcow2 SC-1.vmdk

这篇关于将 qcow2 转换为 vmdk 并使其兼容 ESXi 6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆