Cloning a VM without vCenter in ESXi

ssh to ESXi
# cd /vmfs/volumes/datastore1
# mkdir NEWVM
# cp OLDVM/OLDVM.nvram NEWVM/NEWVM.nvram
# cp OLDVM/OLDVM.vmsd NEWVM/NEWVM.vmsd
# cp OLDVM/OLDVM.vmx NEWVM/NEWVM.vmx
# cp OLDVM/OLDVM-1234.hlog NEWVM/NEWVM-1234.hlog

-clone OLDVM.vmdk
# vmkfstools -i OLDVM/OLDVM_0.vmdk NEWVM/NEWVM_0.vmdk -d thin
# cd NEWVM
# sed -i ‘s/OLDVM/NEWVM/g’ NEWVM.vmx

-add NEWVM into Web Client
open Storage/datastore1/NEWVM
right click NEWVM.vmx/Register VM

-power on NEWVM
click “I Copied it”
click Answer

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s