How to Use VMKFSTOOLS to Clone Disk Step by Step

If you want to clone ESXi VMs but have no vCenter, you can try vmkfstools commands or backing up and restoring the VM to another location. Next, this article will share the steps with you.

Crystal

By Crystal / Updated on March 23, 2023

Share this: instagram reddit

Case: How to use VMKFSTOOLS clone disk without vCenter

 

Hi, I created a new datastore so I want to clone several virtual disks to the new datastore. I only use a free standalone ESXi host and no vCenter. How can I this? Any advice would be appreciated.

- Question from www.reddit.com

You may have known that you can use vCenter Server to clone virtual machines, but it is impossible if you are just using free ESXi. If you don’t want to pay the expensive license, there are still workarounds you can choose.

You can back up the virtual disk and restore it to another location, or clone a VM’s disk via the vmkfstools utility.

How to use vmkfstools command to clone virtual disk

vmkfstools is one of the ESXi Shell commands for managing VMFS volumes, storage devices, and virtual disks. It is a utility specially designed to manipulate VMDKs, offers the ability to clone virtual machine content and also convert from one virtual machine disk format into another.

Next, this article will show you how to use vmkfstools clone virtual disk.

How to use VMware VMKFSTOOLS clone disk

This part will show you some vmkfstools commands you can use to clone disk. Please 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.

1. Log in to ESXi Host Client and enable SSH from the console, then power off the target virtual machine to be cloned.

2. Log in to the VMware vSphere Management Assistant (vMA). Alternatively, open a command-line interface after deploying the VMware vSphere CLI (vCLI).

3. Run the following command to create a new directory within the target datastore. You can skip this step if you have created one.

mkdir /vmfs/volumes/destination-datastore/clone-name

Note: Path to datastore directory may be different on your server, you can find it using “df -h” command and checking the file system.

4. Then you can run the following command to create clone of disk:

vmkfstools -i /vmfs/volumes/datastore/sourcevm/name.vmdk /vmfs/volumes/destination-datastore/clone-name/clone.vmdk

5. If you want to clone virtual disk to thin provision format:

vmkfstools -i /vmfs/volumes/datastore/sourcevm/name.vmdk /vmfs/volumes/destination-datastore/clone-name/clone.vmdk -d thin -a buslogic

Alternative: Clone VM via backup & restore solution

If you are not familiar with vmkfstools commands, and want an easier way to perform VM cloning. You can try backing up the VM and restore to another location.

You can try AOMEI Cyber Backup, a reliable vSphere backup software, which simplifies the backup process and present the steps with intuitive GUI interface. In addition, it offers you the following benefits to protect your VM data.

Agentless Backup: create complete and independent image-level backup for VMware ESXi and Hyper-V VMs.
Flexible vSphere Backup: batch backup large numbers of VMs managed by vCenter Server, or on a standalone ESXi host.
Multiple Storage Destinations: backup to local drive, or network destinations like Windows share or NAS.
Automated Execution: automate backup tasks to run daily, weekly, or monthly and notified by email.
Role Assignment: allows one administrator to create sub-accounts with limited privileges.

AOMEI Cyber Backup supports both paid and free versions of VMware ESXi 6.5 and later versions. Next, I will show you how to perform vSphere VM backup and restore via AOMEI Cyber Backup. You can click the following button to download the 30-day free trial.

Download Free TrialVMware ESXi & Hyper-V
Secure Download

*You can choose to install this VM backup software on either Windows or Linux system.

Steps to perform vSphere backup and restore via AOMEI Cyber Backup

Backup multiple VMs:

1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware > + Add VMware Device to Add vCenter or Standalone ESXi host. And then click > Bind Device.

Add VMware ESXi host

2. Create Backup Task: Navigate to Backup Task > + Create New Task, and select VMware ESXi Backup as the Backup Type.

3. Set the Task Name, Device, Target, Schedule and Cleanup as needed.

  • Task Name: you can change the task name or use the default name with an ordinal.
  • Device: select multiple VMs on the standalone host within one backup task.
  • Target: select to back up to a local path, or to a network path like NAS.
  • Schedule (optional): perform full, differential, or incremental backup, and automate execution according to the frequency you specified.
  • Cleanup (optional): automatically delete the old backup copies that exceed the retention period you specified.

4. Run Backup: Now you can click Start Backup and select Add the schedule and start backup now, or Add the schedule only.

Start Backup

Created backup tasks will be listed and monitored separately for restoring, progress checking and schedule changing.

Restore to new location: Select Restore to new location option to create a new VM in the same or another datastore/host directly from the backup. And click Start Restore to start.

Restore to new location

Summary

Free standalone ESXi host without vCenter cannot perform VM cloning. Luckily, the vmkfstools command offers the ability to clone virtual machine content and also convert from one virtual machine disk (.vmdk) format into another. This article showed how to use vmkfstools clone disks.

Except for using vmkfstools copy disk, you can also perform many other storage operations using the vmkfstools command. For example, creating and managing VMFS datastores on a physical partition, or manipulating virtual disk files stored on VMFS or NFS datastores.

Crystal
Crystal · Editor
Crystal is an editor from AOMEI Technology. She mainly writes articles about virtual machine. She is a positive young lady likes to share articles with peolpe. Off work she loves travelling and cooking which is wonderful for life.