Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Cloning and converting virtual machine disks with vmkfstools (1028042)

Last Updated: 3/10/2021Categories: How toTotal Views: 98672Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

61 like this article

Subscribe to get an email
newsletter with new updates

61 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Purpose

This article provides information and instructions on the use of the vmkfstools command to convert virtual machine disks from one type to another.

Resolution

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:

Shut down the virtual machine. Virtual machine disk files are locked while in-use by a running virtual machine.

Log in to the VMware vSphere Management Assistant (vMA). Alternatively, open a command-line interface after deploying the VMware vSphere CLI (vCLI). If terminal access is required:

For VMware ESX 4.x and 3.x, log in via the terminal or SSH. For additional information, see Connecting to an ESX host using a SSH client (1019852).

For VMware ESXi 4.1 and ESXi 5.x, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.0 (1017910).

For VMware ESXi 4.0 and 3.x, see Tech Support Mode for Emergency Support (1003677).

Run these vmkfstools command to clone the disk from one format to another:

From the ESX/ESXi terminal:

vmkfstools -i input output -d format -a adaptertype

From vMA/vCLI:

vmkfstools --server <vCenter or ESX IP/Hostname> -i input output -d format -a adaptertype

For example, to clone examplevm.vmdk from Datastore to Datastore 2 and thin-provision the destination copy:

From the ESX/ESXi terminal:

vmkfstools -i "/vmfs/volumes/Datastore/examplevm/examplevm.vmdk" "/vmfs/volumes/Datastore 2/newexamplevm/newexamplevm.vmdk" -d thin -a buslogic

From vMA/vCLI:

vmkfstools --server 10.21.49.14 -i '[Datastore] examplevm/examplevm.vmdk' '[Datastore 2] newexamplevm/newexamplevm.vmdk' -d thin -a buslogic

Note: For VMs that reside on vSAN make sure to add -W vsan

Note: Ensure the new destination directory is created prior to cloning the disks.

Warning: If virtual machine snapshots or delta disks are present, ensure that the source chosen is the current snapshot delta disk. Failing to do so results in an outdated destination copy. However, when using the command, the corresponding descriptor file for the latest delta disk needs to be used when cloning the disk.

For example to clone and/or convert virtual machine disk with snapshot (otherwise known as a delta disk), examplevm-000001.vmdk and like above, from Datastore to Datastore 2 , with a thin-provisioned destination copy, run these command:

From the ESX/ESXi terminal:

vmkfstools -i "/vmfs/volumes/Datastore/examplevm/examplevm-000001.vmdk" "/vmfs/volumes/Datastore 2/newexamplevm/newexamplevm.vmdk" -d thin -a buslogic

From vMA/vCLI:

vmkfstools --server 10.21.49.14 -i '[Datastore] examplevm/examplevm-000001.vmdk' '[Datastore 2] newexamplevm/newexamplevm.vmdk' -d thin -a buslogic

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: Running the 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.

For more information on steps to identify a virtual machine's current snapshot, see Confirming a virtual machine's snapshot delta disk layout (1027887).

Note: This process only clones the disk that was specified in the command. To register the newly cloned disk / VM into inventory, it requires a .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.

Related Information

VMware Skyline Health Diagnostics for vSphere - FAQ

Commonly-used disk format options for vmkfstools:

zeroedthick

This is the default option for virtual machine disks created and stored on a VMFS datastore.

thin

This is the default option for virtual machine disks stored on an NFS datastore. It allocates and commits space on demand, growing as more virtual disk space is used.

Note: The configured size of thin-provisioned disks is correctly displayed using the ls command. The disk space consumed by disk files on a datastore is determined using the du command.

eagerzeroedthick

This is a specified format required for cross-host virtual machine clustering and VMware Fault Tolerance (FT) virtual machines. All blocks for the virtual machine disk are allocated and committed with written zeroes at the time of creation. Existing disks can be inflated to this format without destroying existing data. For more information, see Enabling clustering features for an existing virtual disk by converting in place (1035823) and Enabling clustering features for an existing virtual disk by converting while copying (1003491).

rdmp

This is the default Raw Device Mapping format with Physical compatibility mode. Most SCSI commands are passed-through to the guest operating system to/from a mapped physical raw LUN. This is required for cross-host virtual machine clustering; both virtual machines share the same mapping file. This format does not support virtual machine snapshots. For more information, see
Converting a virtual disk into a Raw Device Mapping (3443266).

rdm

This is an additional available Raw Device Mapping format with virtual compatibility mode set. A subset of SCSI commands are passed-through to the guest operating system to/from a mapped physical raw LUN. An added benefit of this format is the support of virtual machine snapshots. For more information, see
Converting a virtual disk into a Raw Device Mapping (3443266).

2gbsparse

This format is compatible with Hosted (desktop) products such as VMware Fusion, Player, Server, Workstation, etc. Virtual machine disks are spanned across several 2GB extents to eliminate potential cross-platform file system compatibility issues. For example, FAT32 supports a maximum file size of 4GB. This format is not supported for running virtual machines in VMware ESX/ESXi 4.x and ESXi 5.x.

Note: For SDK purposes, this property is known as sparse2GB in ESXi 5.0 and later. For more information, see Scope of the sparse2GB property in the vSphere API (2044714) and the VirtualDiskType section of the vSphere Web Services SDK Documentation.

Additional information, types, and parameters are available in the vmkfstools manual pages and product documentation.

Review the manual pages on VMware ESX 3.x and 4.x by running: man vmkfstools

Review command information on ESXi 3.x and 4.x hosts or vMA and vCLI by running: vmkfstools --help

For more information, see the Using vmkfstools section in the ESX Configuration Guide on the product documentation pages for your respective version of VMware ESX/ESXi.

See Also:

Converting a virtual IDE disk to a virtual SCSI disk (1016192)

Enabling clustering features for an existing virtual disk by converting while copying
Determining if there are leftover delta files or snapshots that VMware vSphere or Infrastructure Client cannot detect
Converting a virtual IDE disk to a virtual SCSI disk
Using Tech Support Mode in ESXi 4.1, ESXi 5.x, and ESXi 6.x
Cloning individual virtual machine disks via the ESX/ESXi host terminal
Enabling clustering features for an existing virtual disk by converting in place
Clonar y convertir el formato de discos de máquinas virtuales usando vmkfstools
Clonagem e conversão de discos de máquinas virtuais com vmkfstools
Scope of the sparse2GB property in the vSphere API
vmkfstools を使用した仮想マシン ディスクのクローン作成および変換
使用 vmkfstools 克隆和转换虚拟机磁盘
Converting a virtual disk into a Raw Device Mapping
Troubleshooting virtual machine snapshot descriptor problems

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

Take Our Survey

Support Assistant