Several of my recent clients (my current one included) have both avoided, failed or just not used Virtual Machine (VM) templates. Depending on who you ask the answer to the question “Why Not?” seems to vary between:
- “I didn’t know that you could do that”
- “We couldn’t make it work”
- “It was too complicated to setup”
- “We haven’t had the time yet”
- “All of our new VMs are different”
After some convincing I have persuaded my current client to let me configure sysprep and a couple of templates for them. I’ve done this a few times before but never really documented it. Admitedly a lot of this is already documented in the Basic Admin Guide for vCenter but this post saves downloading a PDF file.
To test that sysprep and creating VMs from templates works, you first need some templates. This is straightforward to do. All you need to do is create a VM, build it to the stage that you want your VMs to be created at (e.g. OS installed and patched, maybe install some basic applications) and then shut it down. It is sensible to give the VM an IP address that will not be used by any other VM or server so that you can make adjustments to it later. Also, it should have a name that you’re not going to use for another VM and if a Windows server should not be joined to a domain. To convert the VM into a template, just right click on it and select “Convert to Template…”.
For my current client I created two templates, both Windows 2003.
1. Called “build_std32_c10” is Windows 2003 Standard 32bit with SP2. It has a 10Gb C: drive, a 5Gb E: drive and several applications and service installed such as zip utilities, commonly used scripts and a backup client (no VCB yet)
2. Called “build_ent64_c20” is Windows 2003 Enterprise 64bit with SP2. It has a 20Gb C: drive, a 5Gb E: drive and several applications and service installed such as zip utilities, commonly used scripts and a backup client (no VCB yet)
To enable the templates that you have created to be deployed as unique VMs, you need sysprep correctly setup. vCenter does not include sysprep when you install it as it’s a Microsoft tool. Consequently you have to download a few files and arrange them in certain folders on the vCenter server.
1. Download Sysprep Update 1.1 from Microsoft
– Run the executable to extract the files
– Place the extracted files in the “tools” folder in the folder “C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep\1.1” on the vCenter server
2. Download System Preparation tool for Windows Server 2003 Service Pack 2 Deployment from Microsoft
– Run the executable (on a 2003 server) to install the update
– Use a zip utility to open the file c:\windows\system32\deploy.cab
– Copy the files to the folder “C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep\svr2003” on the vCenter server
3. Download System Preparation tool for Windows Server 2003 Service Pack 2 Deployment (x64) from Microsoft
– Use a zip utility to open the EXE file archive
– Drill down into SP2QFE\deploy.cab
– Copy the files to the folder “C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep\svr2003-64” on the vCenter server
Now you’re ready to create a VM. Just locate the template (use the “Virtual Machines and Templates” view in the VI client), right click and select “Deploy Virtual Machine from this Template…”.
Michael is a Senior Consultant for Xtravirt. If it's got buttons or flashy lights on it then it'll probably be on his radar. When not "mending computers" (it's sometimes easier than explaining "cloud" to relatives), Michael provides essential education, entertainment and trampoline services to his two children.