Creating a VM clone for a virtual machine template

Cloning a virtual machine is an efficient alternative to creating a new VM for test and development. This tip offers a walkthrough on how to create a VM clone.

A VM clone is a complete duplicate of a particular virtual machine (VM) at that precise moment in time.

Cloning a virtual machine is not intended for backup, disaster recovery (DR) or other data protection purposes. The most common use of a VM clone is in the mass deployment of standardized VMs. Cloning a virtual machine that is appropriate for a new workload and tailoring it for specific needs is more efficient than creating new VMs manually and then installing their operating systems and applications.

VM cloning is also useful for test and development. A workload may be cloned from the production environment and placed on another server in the lab, which allows development personnel to work with a real workload without interfering with production.

More VM clone resources:
Cloning a VM on an ESX server

Creating virtual machine clones and templates

The traditional process of cloning a virtual machine normally starts by quiesceing and then creating a VM snapshot backup of the source. It is not typically necessary to snapshot the source VM's memory, so disabling that option can usually speed up the snapshot process. Once the snapshot is complete, the original VM should leave the quiesced state and return to normal operation with little (if any) perceivable disruption to users.

In a VMware environment, the next step is to create a new VM using the virtual infrastructure (VI) Client. When configuring the resources for this new VM, do not assign a physical NIC. Assign a virtual switch instead, and stick with the default hard drive size. Do not activate the new VM just yet.

Now, use the command line interface to delete the virtual disk files for the new VM. Open the folder where the new VM resides and delete all of the VMDK files, leaving you with a new (but empty) VM.

At this point, go to the folder containing the snapshot of the original VM. Copy the snapshot to the new VM folder using the command line interface and the "vmkfstools" command. That places the content of your original VM into the new VM instance. The VI Client will allow administrators to activate the new VM. As long as the new VM is not running on a real physical NIC, it will not interfere with the original production VM.

Perform a little housekeeping by deleting the snapshot, which is no longer needed. Deleting the snapshot frees up unneeded disk space and minimizes file clutter. The VM clone will now function exactly like the original workload, and it can be migrated to other servers if needed.

Today, virtualization platforms have automated much of the process of cloning a virtual machine.


 

This was first published in January 2010

Dig deeper on Introduction to virtualization and how-tos

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close