WHY WOULD I WANT TO CLONE A VIRTUAL MACHINE? Good question. One could make a clone copy of a Virtual Machine (VM) for the purpose of creating a back-up; however, more commonly, the cloning of a frequently-used “base” machine build makes the creation of a complex virtual environment much easier.
Consider this. To build a Virtual Machine from scratch, one would launch the VMWare Server Console, choose File | New | Virtual Machine… and then begin the process of specifying the intended guest Operating System (OS) and hardware components for the virtual machine. After Specing out a virtual hardware platform and creating the virtual disk, one would start the virtual machine and only then be able to begin installing the guest OS. After completing a base installation and a rudimentary configuration (generally including a bridged, DHCP-enabled virtual NIC) of the operating system, it would then be a prudent practice to download and apply any patches or critical updates desired by the OS in the virtual machine.
As you can see, apart from the virtual hardware configuration, the process of building a virtual machine mimics the process of building any physical machine. A reasonable expectation would be 4 hours to build and patch a typical OS installation. If you are building one machine, this cost is relatively fixed .. but what if you want to build a more elaborate Active Directory domain or forest? What if you are building a test Active Directory domain where you wish to have a Domain Controller, an Exchange Server, a WSUS Server, and a two member MS-SQL 2005 cluster?
Similar to the idea of Ghosting or RISing-up an image, we can use copy and paste functionality to clone a virtual machine image. Instead of building 5 separate virtual machines (potentially consuming 20 Hrs just to build the operating systems on each) we can build one base install and copy it for each machine to be brought-up in the environment.
Now this paper does not cover building a Master machine image, and our builds were taking place on VMWare Server v1.0.1. For the following process, we are assuming that the person following this instruction set will have familiarity with the Windows environment and file/folder manipulation through Windows Explorer.
CAUTION: For the purpose of this paper, we will negate software licensing concerns by assuming that evaluation software packages have procured for the purpose of building a test environment.
Steps to Create a Clone
Start VMWare Server
Choose Host | Settings…
On the General Tab, the default location (your working directory) for your Virtual Machines will be shown
Note the location
Stop the instance of the Virtual Machine you wish to clone
Through Windows Explorer, browse to the folder containing the Virtual Machine files
Right click on the VM you wish to clone
Right click in the open space under the folder list
The Copy process will begin .. depending upon the size of the Virtual Machine’s disk file/s this may take some time
Right click on the folder that was created by the copy process
Change the folder name
Tip: I typically use folder names descriptive of the VM guest OS and the intended server function
Start VMWare Server
Choose File | Open…
Move up one folder level
Drill down into the folder of the intended clone VM
Select the .vmx file
The VM will be added to the Inventory pane
Right click the virtual machine
Rename it to avoid confusion
Tip: I usually indicate the guest OS, function, and intended IP address for running on my virtual network
Click Start the virtual machine
On the first startup of a cloned VM, you will receive a prompt regarding your desired action for the UUID of the virtual machine
And the VM startup process will begin
Login into the virtual machine
Download or copy a program to change the computer’s SID.
Tip: Save the program to the Windows Desktop
Tip: I use NewSID which can be downloaded from http://www.microsoft.com/technet/sysinternals/Security/NewSid.mspx
Right click on the ZIP file
Choose Extract All…
The Extraction Wizard will begin
Select a Destination for the decompressed files
Tip: Accept the default location
Double click newsid.exe
End User License Agreement
Choose Random SID
A SID will be generated
Tip: Remember to computers with the same hostname will cause a network conflict
Check the checkbox to perform a rename
Rename the Computer
Check the checkbox to allow an automatic reboot
The new SID and computer name will be applied to the computer and then the virtual machine instance will be rebooted
Conclusion: Attack of the Clones!
As environments have become increasingly complex, especially in large organizations, companies are trying to reduce their IT footprint while squeezing more performance out of their systems. Factors such as AC power, HVAC requirements, and the annual costs of maintaining physical servers are becoming more closely scrutinized. Conversely, the adoption of expandable infrastructure such as high-density core switches and scalable storage systems is moving down across the markets and filtering into the small-to-medium sized business markets.
Server virtualization is a common practice in both production and test environments because it facilitates a lower Total Cost of Ownership (TCO). The more skill and finesse we have with manipulating and leveraging technologies such as VMWare Server, the more efficient, agile, and cost-effective our IT operations can become.