-ESXi Utility to clone a single VMware virtual disks. SSH to the ESXi host and run the below command.
-On a powered OFF VM run it on the disk.vmdk (not the disk-flat.vmdk)
-On a Powered ON VM first create a snapshot so that the VM runs off delta and then run it on the base disk.vmdk (not disk-flat.vmdk) as the base disk drops locks and becomes read-only
-Useful if your LUN runs out of space and the VM stops and you can’t free up space. You can clone the disk to another LUN and attach it to a new VM.
-Also Useful if you need to clone a single disk from a VM that has a lot of disks attached to it.
vmkfstools -i /vmfs/volumes/Lun1/VM1/VM1.vmdk -d thin /vmfs/volumes/Lun2/VM1/VM1.vmdk
Options for the type of disk you can clone to:
zeroedthick
thin
eagerzeroedthick
rdm:
rdmp:
2gbsparse
Works, take a snapshot of a running VM first so that it releases the locks on the base disk, or do this in a powered OFF vm. Either way works.
[root@esxipr001:/vmfs/volumes/12345678-b0cc24e0-be43-0025b5d55000/VD05WSQLQA014_2016] vmkfstools -i /vmfs/vol
umes/G800_SAS_SH-DV01/VD05WSQLQA014/VD05WSQLQA014.vmdk -d zeroedthick /vmfs/volumes/12345678-b0cc
24e0-be43-0025b5d55000/VD05WSQLQA014_2016/VD05WSQLQA014_2016.vmdk
Destination disk format: VMFS zeroedthick
Cloning disk ‘/vmfs/volumes/G800_SAS_SH-DV01/VD05WSQLQA014/VD05WSQLQA014.vmdk’…
Clone: 12% done.