Clone VMs in ESXi free version

A few manual steps are required, using the ESXi CLI:




ESXi server

 # uname -a
VMkernel localhost 5.5.0 #1 SMP Release build-2068190 Aug 22 2014 19:00:51 x86_64 GNU/Linux



Datastore "thin_lun"

/vmfs/volumes/54e768e2-8028c5cf-3fa9-000c29f4e964/archlinux # df -h
Filesystem   Size   Used Available Use% Mounted on
VMFS-5     233.5G   1.2G    232.3G   1% /vmfs/volumes/datastore1
VMFS-5     249.8G 224.1G     25.7G  90% /vmfs/volumes/thin_lun

VM to clone "archlinux"
 # pwd
/vmfs/volumes/thin_lun/archlinux

# ls -1
archlinux-e9367b6d.vswp
archlinux-flat.vmdk
archlinux.nvram
archlinux.vmdk
archlinux.vmsd
archlinux.vmx
archlinux.vmx.lck
archlinux.vmxf
archlinux.vmx~
vmware-1.log
vmware-2.log
vmware.log
vmx-archlinux-3912661869-1.vswp
vmx-zdump.000


To clone a VM in ESXi free edition, you need to do a few manual steps:

1. Create the destination folder
 # pwd
/vmfs/volumes/thin_lun/
# mkdir archlinux2

2. Clone the vmdk of the original VM into the new folder (give a name to the new vmdk file, also specify thin or thick format) 

 # vmkfstools -i /vmfs/volumes/thin_lun/archlinux/archlinux.vmdk /vmfs/volumes/thin_lun/archlinux2/archlinux2.vmdk -d thin
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/thin_lun/archlinux/archlinux.vmdk'...
Clone: 16% done....

The VM must be powered off for the cloning to work.



3. Create a new VM using the vsphere client. Choose "Custom" 




















4. Choose the option to use an existing disk when, and use the newly cloned vmdk 






After the new VM is created power it on, it will be a clone of the original VM.