The Home of Puny Robologic

Wandering where my personal Muse takes me.... usually to the workld of infrastructure technology, but often I'm guided along other paths too.

Creating a Windows Server 2008 Template in SCVMM 2008

Creating a Windows Server 2008 Template in SCVMM 2008

  • Comments 2
  • Likes

If you’re using SCVMM 2008 to manage your Hyper-V hosts, then you’ll know that you can reduce the time to provision virtual machines by using Templates.  In this blog post I’ll outline a simple step by step guide to creating your own Windows Server 2008 based Template.  The template is effectively a sysprep’d image of a Windows Server 2008 source machine. Once a template has been created and stored in the VMM 2008 Library, it can be used to provision Virtual Machines.  As part of this provisioning process, it usual to create a series of hardware profiles, to right-size the virtual machine, and a series of Guest OS Profiles, to control OS customisation during Virtual Machine Creation.

The Key Steps in template creation and deployment are:

1) Create a source Virtual Machine that will be used to create the Template

2) Install Windows Server 2008 into the source Virtual Machine and customise it as appropriate

3) Create the Template from the source Virtual Machine.

4) Create some Hardware and OS profiles

5) Deploy a Virtual Machine from the Template using hardware and OS profiles

 

1) This first step will create a Windows Server 2008 VM to be used as the source machine for the Template.  Use the “New Virtual Machine” wizard as follows:

1.1  Create a new VM with a blank hard disk

1.2 Name the Virtual Machine

1.3 Configure the Hardware for the VM.  Think carefully about the size and type  of the hard drive as this will be used for all virtual machines you create from this template. You may also want to remove the default Emulated NIC and add a Synthetic NIC instead.

1.4 Place the Virtual Machine on an appropriate host.

1.5 Complete the Wizard and create the Blank VM.

You should now have a VM created on your host and it should be in the STOPPED state.

 

2) This 2nd step will install Windows Server 2008 operating System into the Virtual Machine

2.1) Connect either an appropriate ISO DVD image, or a physical DVD drive to the source Virtual Machine.

2.2) Install the Operating System as usual.

2.3) Install Integration Components.  Right Click the VM in SC VMM 2008 Console and select “Install Virtual Guest Services”.   This process will stop the Virtual Machine, if running, install the Integration Components into the Virtual Machine, and will then Stop the VM.

2.4) After the guest services installation has succeeded, start the VM, logon locally and perform the following customisation to disable complex passwords:

Use GPEDIT.MSC to set disable password complexity. The setting can be found as below under:

Local Computer Policy->Computer Configuration->Windows Settings->Security Settings->Account Policies->Password Policyimage

2.5) Set a blank password for the local administrator account. This is a required step, but does NOT mean that the Virtual Machines you create with this template will have blank passwords.

2.6) Customise the Win 2008 Image (Enable Remote Desktop, Disable Shutdown Event Tracking, Install AV, etc)

2.7) Shutdown  Win2008 VM

2.8) Ensure that no media is mapped to the DVD Drive of the guest virtual machine.

3) This 3rd step creates a new template from the Virtual Machine you have just created and configured. 

Note that the act of creating a template destroys the source Virtual Machine.  So, as you go through the process of learning how to create a template, you may wish to create a CLONE of this source virtual machine and store it in the library for re-deployment.  This enables you to rapidly restore the source Virtual Machine prior to running the template process, a useful thing to do whilst becoming familiar with the templating process.

3.1) Right click the source Virtual Machine and select “New Template

3.2) Name the template, click Next

3.3) When the hardware configuration page appears, simply click next.   Note that the values you set here are defaults used when creating a Virtual Machine from the template.  They can be overridden by the use of a Hardware profile at deployment time.

3.4) Under Guest OS, you have the option of pre-setting common OS configuration items, such as computer name, local admin password, product key etc.  The values you set here are defaults used when creating a Virtual Machine from the template.  They can be overridden by the use of a Guest OS profile at deployment time.

NOTE: Windows Server 2008 VOLUME LICENSED code uses KMS (Key Management Services), and when when installed manually DOES NOT require you to enter a PID. HOWEVER, when installing Windows Server 2008 VL source using an automated mechanism a PID IS required. Use the appropriate PID in the following table which is listed in the public “Volume Activation 2.0 Deployment Guide” available here:

http://technet.microsoft.com/en-us/library/cc303280.aspx

Operating System Edition

Product Key

Windows Server 2008  Datacenter

7M67G-PC374-GR742-YH8V4-TCBY3

Windows Server 2008 Datacenter without Hyper-V

22XQ2-VRXRG-P8D42-K34TD-G3QQC

Windows Server 2008 Enterprise

YQGMW-MPWTJ-34KDK-48M3W-X4Q6V

Windows Server 2008 Enterprise without Hyper-V

39BXF-X8Q23-P2WWT-38T2F-G3FPG

Windows Server 2008 Standard

TM24T-X9RMF-VWXK6-X8JC9-BFGM2

Windows Server 2008 Standard without Hyper-V

W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ

Windows Web Server 2008

WYR28-R7TFJ-3X2YQ-YCY4H-M249D

3.5) Select an appropriate Library Server to store the template, then click next.

3.6) Browse the SC VMM 2008 Library and select a path to store the image.  I normally select a TEMPLATES folder for simplicity. Click next.

3.7 Click Create.   Be Patient  :-)

4) In this step we will create some hardware and OS profiles that can be used when creating a new VM from the template..

4.1) Lets create some Hardware profiles so that we can creating Virtual machines of different “sizes” using the same Template.  Change to the Library view and under “Library Actions” select “New hardware profile”. Type a name for the profile, some descriptive text, then edit the hardware settings and customise as appropriate.  As an example, here are the hardware profiles I have created on my demo system. The name reflects the configuration of the hardware to make selection easier.image

The hardware settings of the above highlighted hardware profile are as below:image

When we provision a virtual machine from the template using the above hardware profile, we will create a VM with 4 virtual CPU’s, 4GB of memory and a single synthetic network adapter.

For further detailed information on these hardware Settings read this:

How to Modify the Properties of a Hardware Profile

4.2) Now lets create some OS Profiles to customise the Operating System.  In the same Library view select “New Guest OS Profile”. Type a name for the profile, some descriptive text, then edit the Guest OS settings and customise as appropriate.  As an example, here are the guest OS profiles I have created on my demo system. Yet again, the name reflects the configuration of the OS to make selection easier.image

The OS Settings of the highlighted entry are as follows: image

The “Identity Information” is set to “*”. This will autogenerate a computer name.  I have also set the password for the local administrator account, and set the product key to be an MSDN key. 

You can even import an existing answer file (Unattend.XML for Win 2008") to prepopulate the OS settings.

For further detailed information on these OS Settings read this:

How to Customize the Operating System of a Virtual Machine

5) So Now lets create a VM from the template and use the hardware and OS profiles to both right size and customise the Virtual Machine.

5.1) Select the New Virtual Machine wizard

5.2) Select “use an existing VM, template of virtual hard disk” and click “Browse”

5.3) Select the template we created in 3) and click OK. Click Next.

5.4) Name the Virtual Machine. This will be the name of the VM as it appears in the SCVMM 2008 console, and NOT the “computer name”.

5.5) Under “Configure Hardware” either accept the default settings (from the template) or select a hardware profile we created in step 4. Click Next.

(Remember that even though you select a pre-configured hardware profile, you can still override individual settings in the profile, like Memory size for example.)

5.6) Under “Guest OS” either select the default settings (from the template) or select an OS Profile we created in Step 4. Click Next.

(Remember that even though you select a pre-configured OS profile, you can still override individual settings in the profile, like “Computer Name” for example.)

5.7 Place the virtual machine on a host, select the host, and compete the remainder of the wizard.

5.8) You should now see a Job running to create the virtual machine.  Typically, the job should look like the one below:image

Have Patience and enjoy experimenting with creating templates!

Technorati Tags: ,
Comments
  • Here’s an issue that might bite you if you’re not mindful of it.  I ran across this a few days ago

  • Everthing was great until creating the system from template phase. Then I got:

    Error (12700)

    VMM cannot complete the Hyper-V operation on the it-nlwest.sooner.net.ou.edu server because of the error: 'it-SPsecure' failed to add device 'Microsoft Virtual Floppy Disk'. (Virtual machine ID 41A09B33-EDC3-4C46-989D-E669C472F42C)

    'it-SPsecure': Attachment 'C:\ClusterStorage\Enclosure1\it-SPsecure\it-SPsecure.vfd' not found. Error: 'The system cannot find the file specified.' (0x80070002). (Virtual machine ID 41A09B33-EDC3-4C46-989D-E669C472F42C)

    (Unknown error (0x8003))

    Recommended Action

    Resolve the issue in Hyper-V and then try the operation again.

    I did a lookup in Technet, on the web and did not find anything pertaining to floppy disk.  Lots of stuff on ISO images, but nothing on the flavor of Error 12700.

    Any suggestions?

    I was able to go to the local host that the VM resides on, and manually start the server.  So far, it looks good.  There is no floppy, but I don't care about that.

    -bruce

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment