This article provides information and instructions on the use of the vmkfstools command to convert virtual machine disks from one type to another.
VMware vSphere ESXi 6.x
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x
The vmkfstools
command offers the ability to clone virtual machine content and also convert from one virtual machine disk (.vmdk) format into another.
Note: The host operating system chosen to perform the conversion may not necessarily support running of virtual machines via the output format defined. vmkfstools maintains the possibility of exporting virtual disks for use in other VMware products which support alternative disk formats.
To convert a virtual machine disk from one type to another:
vmkfstools
command to clone the disk from one format to another:From the ESX/ESXi terminal:
vmkfstools -i input output -d format -a adaptertype
For example, to clone examplevm.vmdk
from Datastore
to Datastore 2
and thin-provision the destination copy:
examplevm-000001.vmdk
and like above, from Datastore
to Datastore 2
, with a thin-provisioned destination copy, run these command:vmkfstools -i "/vmfs/volumes/Datastore/examplevm/examplevm-000001.vmdk" "/vmfs/volumes/Datastore 2/newexamplevm/newexamplevm.vmdk" -d thin
Note the selection of examplevm-000001.vmdk
, as opposed to examplevm.vmdk
for the input file. Snapshot delta disk files are appended a sequencing number, differentiating one snapshot delta disk iteration or level from another. Selecting the most recent delta disk ensures that the most recently stored data is cloned to the destination.
Note:
vmkfstools -i
command creates a cloned drive with an LSI controller, even if the source disk is using VMware Paravirtual. This results in the virtual machine failing to boot. To resolve this issue, change the controller type to the same as the source.vmx
file. Manually copy the vmx
from the cloned VM and adjust the vmx
file to provide the path to the newly cloned disks or create a new VM from the UI and select the cloned disks in the Hard Disk section. VMware Skyline Health Diagnostics for vSphere - FAQ
For more information on vmkfstools
disk options please check VMware vSphere Product Documentation
See Also:
Determining if there are leftover delta files or snapshots that VMware vSphere or Infrastructure Client cannot detect
使用 vmkfstools 克隆和转换虚拟机磁盘
Converting a virtual disk into a Raw Device Mapping
Troubleshooting virtual machine snapshot descriptor problems