Creating a VM clone for a virtual machine template

Creating a VM clone for a virtual machine template

Stephen J. Bigelow, Senior Technology Writer
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.

    Requires Free Membership to View

    When you register, my team of editors will also send you the latest expert resources covering all areas of server virtualization, such as platforms, architectures and strategies, server hardware, managing virtual environments, application issues and more.

    Margie Semilof, Editorial Director

    By submitting your registration information to SearchServerVirtualization.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchServerVirtualization.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.