Cloning a VM without vCenter in ESXi

-create an empty new vm from GUI

ssh to ESXi
# cd /vmfs/volumes/datastore1
# vmkfstools -i OLDVM/OLDVM.vmdk NEWVM/NEWVM.vmdk -d thin
# cd NEWVM

-make sure NEWVM.vmdk point to correct flat file
# cat NEWVM.vmdk
RW 83886080 VMFS “NEWVM_1-flat.vmdk”
# ls
NEWVM.vmsd           NEWVM.vmx            NEWVM-flat.vmdk  NEWVM.vmdk

-as you can see vmdk looking for the file that doesn’t exist
-so just rename the file file
# mv NEWVM_1-flat.vmdk NEWVM-flat.vmdk

modify NEWVM.vmdk
RW 83886080 VMFS “NEWVM_1-flat.vmdk”
RW 83886080 VMFS “NEWVM-flat.vmdk

-to rename vmdk, do not use cp or mv. Use vmkfstools instead
# vmkfstools -E OLDVM.vmdk NEWVM.vmdk

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s