To clone a virtual machine with VirtualCenter you have to power off the guest, but what if your next maintenance window isn’t any time soon, you can’t afford to schedule the outage, or you just need a copy of the VM during normal business hours? Did you know that making a copy of a running, powered on VM is possible. At a high level the process requires a snapshot to freeze the VM’s original disk which in turn allows you to clone the frozen disk. This is essentially the way VCB, vRanger, or any of the live VM backup products work. Therefore, cloning a powered on VM can be accomplished with a little Console command magic.
I want to acknowledge that researching this method was inspired by the VMTN Virtualization Roundtable Episode 1 Podcast’s coverage of snapshots. Specifically Eric Siebert mentions that using VMware Converter as an alternative to committing snapshots is not the best option and offers the idea of using vmkfstools to do the job.
Also, this step by step guide is based on the “How can I hot clone a VM without using VMware Converter?” tip found at Vmware-land.com’s VMware Tips.
- Login to the Service Console (Use mRemote or Putty for remote Console Access)
- Switch to your source VM’s directory.
- Create a snapshot
- Create a new VM using the VI Client
- Back at the Console Delete the .vmdk files of the new VM.
- Copy the original disk to the new VM directory
- Power on your new VM using the VI Client.
- Delete the snapshot