The Most Under-Appreciated & Under-Used Feature Of VMM: VM Templates

Over the years, I’ve talked to people who own VMM and I’ve seen a few customer installations.  Way too often I see one of these two things:

  • An empty VMM library
  • People are not deploying VMs from VM templates

The VMM Library

Adding files to the library is easy: you use Windows Explorer to copy the files into the share.  If you can’t do that, maybe a job in IT isn’t appropriate?  The library in the console refreshes every 1 hour by default.  You can wait, or you can right-click the library and force a refresh.  Now you have a repository of reusable contents.

Personally, that’s where I like to keep the ISOs that I download from Microsoft and others.  Some software doesn’t come as an ISO, so I’ll use some free utility to “burn” and ISO with the installer on it.  You’ll find a nicely populated MSSCVMMLibrary folder in our lab at work, and on my Windows 8 (Client Hyper-V) laptop.

To save space, WS2012 deduplication is enabled on the library volume in the VMM server.

This is also where I keep my VHDs.  But more on that Smile

VM Templates

Microsoft has a different way of thinking about VM Templates than VMware.  From what I am told by VMware customers, every virtual machine template in vSphere consists of a VMDK and some metadata.  It’s the Ghost approach – lots of images.

Microsoft went a more modular route.  A VM Template is made up of:

  • A linked VHD/X file: generalised by Sysprep if it’s got a Windows OS
  • An OS profile: how do you want to customise the OS deployment in the VHD/X?  This includes computer naming, local admin password, roles/services, etc.
  • A hardware profile: how do you want to customise the virtual hardware spec of the VM?  This is the entire set including, processors, memory, disks, network (and VM network connection, etc), and so on.

You can have a single WS2012 VHD/X.  You can create lots of OS profiles.  You can create lots of hardware profiles.  And you can create lots of VM templates.  You link:

  • A VHD/X.  A single VHD/X can be reused many times.
  • A OS profile: maybe some VM templates will be for basic servers, some will be file servers (with all the storage stuff enabled), some will be web servers (with IIS enabled), and some will be .NET application servers (with .NET Framework enabled).
  • A Hardware Profile: How should this type of server be specced?  Maybe SQL Servers should have Startup RAM of 1024 GB and 2 additional VHDX files on the SCSI controller?

The concept here is that you can create lots of VM templates from a single VHD/X file.  That means you have a single, already patched and hotfixed, VHDX file for every kind of VM deployment with that OS.  Single image deployment – it’s the achievable dream in OS deployment … and it’s really easy with VMM if you bother to try.  You can deploy new VMs directly from your VM templates.  Maybe you make no changes in the wizard, but you can also further customise the VMs at this point.

Now deployment is easy.  For example, I need to build a lab for a series of events on WS2012 non-Hyper-V features for the next few weeks.  I could waste a lot of time by deploying lots of VMs, not from templates, patch the suckers, customise hardware, lots of reboots, and enabling features/roles, and lots more reboots.  Or I could be clever, and build a single VM, update the patching, turn it into a template (power it down, right click, Create VM Template), create more custom VM templates from that single VHDX file, and deploy my lab really quickly from that.  Which one do you think I’ll be doing? Smile

Give yourself a couple of hours.  Create a couple of VM templates based on your most common deployments, and you’ll save tonnes of time later on.

BTW, you can’t do self-service without templates, and you can have a cloud (of any type) without self-service.

10 thoughts on “The Most Under-Appreciated & Under-Used Feature Of VMM: VM Templates”

  1. I don’t use it because, at least in Hyperv 2008 creating a Template from a VM destroyed the original VM. In order to keep the templates updated (patched) then you needed to keep a copy of the non-syspreped original VM and recreate the template after each patch.

    Maybe I amb wrong, but I found cloning a regular VM and syspreping it after cloning a better way to handle the ‘deploy from template’.

  2. Best way to update a template in VMM without hitting the 3-activation limit for some hosts that cant talk to a KMS server?

    1. Do it without deploying the VHD with an offline update. See things like DISM, powershell scripts, and possibly the Virtual Machine Servicing Tool.

      1. Thanks Aidan.

        VM Servicing Tool does not yet support SP1. (It cannot detect SP1 as a valid VMM instance.)

        Hopefully MS will go back and update this tool.

        – rp

  3. I’m an anomaly. Was one of the first things I set up after I took the course. To me templates were one of the biggest selling features.

    My most disliked feature in the history of this product though, has to be the upgrade path of VMM 2012 to VMM 2012SP1. That was a complete dogs breakfast.

  4. Hi Aidan,

    I know it’s not a Hyper-V issue, but if I created a basic WS2012Std template, then use it to create a VM, can I then install SQL on that VM and create a template from the new VM, or do I have to start from scratch for each template?

    Also, you recommend that “Maybe SQL Servers should have Startup RAM of 1024 GB…” – is a terabyte normal these days?


  5. Hi Aidan

    I am using templates extensively on my 2012 scvmm infrastructure but have been facing an issue wherein i have 3 IDE disks and 4 SCSI disks (for sql).
    But everytime i create a VM using this template it restarts the VMM service and the creation fails.
    Any known issues?

  6. How’s things?, on occasion I see a 404 website message when I arrive at this site. I thought you may wish to know, cheers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.