Cloning a Machine Inside ESX

Table of contents
No headers

    

    

As we don't feel like paying 3 grand for VirtualCenter, we will be needing to clone machines using the CLI. It's really not a big deal and takes just about the same amount of time as using VirtualCenter.

    

  • Make sure the VM you're cloning is off.
  • SSH into the ESX box @ 192.168.168.212.
  • Navigate to the virtual datastore (currently located at /vmfs/volumes/mindtouch-esx1:storage1). Tab-complete to make life easier.
  • Make a directory with the name of the VM you're going to clone.
  • cd to the directory that contains the VM you want to clone.
  • Type vmkfstools -i <NAME_OF_VM>.vmdk ../<NAME_OF_DESTINATION_FOLDER>/<NAME_OF_CLONED_VM>.vmdk
  • After the clone finishes, go back into the ESX control panel, and restart the machine you cloned (if needed). Create a new VM, and when it gets to Creating A Disk, select "Use Existing..." and browse to the disk you just cloned. Continue creating the VM as normal.

   

To import a thin-provisioned vm from somewhere, follow the commands above with the exception of the vmkfstools one... supplant that with the command below (note that this will create a minimally-sized fixed disk, as it is not dynamically growable inside of ESX as opposed to vmware server):

vmkfstools –i /tmp/DekiDrive.vmdk –d thin /vmfs/volumes/myvmfs3/deki/DekiDrive.vmdk 

    

Tag page
You must login to post a comment.