Wednesday, 29 April 2015

Creating a Server 2012 R2 VM template in vSphere 6.0

Within vSphere 6.0 (5.0 and 5.5) you have the ability to create VM templates that can be utilizied in scenerios where you have multiple operating systems that need to be deployed.

There are three ways of creating a VM template:

- Converting a Virtual Machine to a Template in the vSphere Client
- Cloning Virtual Machine to Template in the vSphere Client
- Clone a template in the vSphere Client.

For this tutorial I will be creating an initial Server 2012 R2 VM with the following specs:

Operating System: Windows Server 2012 R2
Disk Controller (OS / Boot Disk): LSI Logic SAS (must not be part of a MS cluster!)
Secondary Disks (Non-boot disks): Paravirtual Controller
Disk: 40GB, Thick Provision Eager Zeroed, SCSI Node 0:0
Floppy Drive 1: Removed
CPU Virtual Sockets: 1
Cores per Socket: 2
VMware Tools: Check and upgrade Tools during power cycling
Virtual Hardware Version: 11

We will make the following tweaks to the VM bios settings:

Advanced >> I/O Device Configuration:

- Serial Port A = Disabled
- Serial Port B = Disabled
- Parallel Port = Disabled

We can also make the following conifugrations to the OS itself:

- Enable Remote Desktop
- Change the computer name e.g. 2012R2-TEMPLATE
- Perform a Windows Update
- Internet Explorer Enhanced Security (Admins) = Turned off
- Internet Explorer Enhanced Security (Users) = Turned on
- Local User Accounts >> Administrator >> Password Never Expires = Checked.
- Power Plans >> High Performance = Checked
- Disable Hibernation: powercfg.exe -h off
- Folder options >> Show hidden files, folders and drives = Checked
- Folder options >> Hide extensions for known file types =
- Event Logs: Clear System, Security, Application
- Start bar, desktop customizations.
- Degrament the C: / System Drive.

I would like to ensure that the customizations I have made to my administrator profile are replicated throughout all user's environments - so we can use a utility called defprof that will copy a speicifed user's profile data to the Default Windows User Profile like follows:

defprof source_profile_folder

We should then shutdown the VM.

We can now take advantage of the Customization Specifications Manager which provides us with the ability to further customize certain Windows and Linux distributions by going to the vSphere Web Client >> Customization Specifications Manager >> Create a new specification:

Target VM Operating System: Windows
Customization Spec Name: Windows 2012 R2 Base
Set Computer Name = Enter a name in the Clone / Deploy Wizard
Domain Settings
Set Operating System Options >> Generate New Security ID (SID) = Checked.
and so on...

We can now simply convert our VM to a template by right-hand clicking on the VM and selecting Template >> Clone to Template.

Then to create a new VM from this template - right-hand click on the template and select "Deploy virtual machine from this template". During the wizard ensure that in the "Guest Optimization" section that you select "Customize using an existing customization specification."


Post a Comment