In this blog post I will show you how to create a Windows Server template and how to maintain it. Templates are virtual machines to be used to create new virtual machines. So, for example, if you need to install a new Windows Server it is easier to just deploy a virtual machine from the template rather then completely install Windows from scratch. The template can have the latest Windows updates and so, the newly created virtual machine, is already up to speed with the patches and can even contains all you application needed to meet company policy.
Creating the template:
I’m not describing how to install Windows but I would recommend to look at this blog post to create a ISO file with the VirtIO drivers included: https://www.jeroentielen.nl/slipstream-virtio-drivers-into-windows-iso-to-use-on-nutanix-ahv/
When Windows is completely installed the way you want it for all Windows virtual machines you need to run sysprep. Sysprep is a built-in tool in Windows to make the Windows installation ready to be cloned. Open an elevated prompt and run:
C:\Windows\system32\sysprep\sysprep.exe /shutdown /oobe

If this generates an error you probably need to remove the Windows Store apps. Review the log file it shows in the error. More info here: https://learn.microsoft.com/en-us/troubleshoot/windows-client/setup-upgrade-and-drivers/sysprep-fails-remove-or-update-store-apps
Here is my powershell script to remove the AppX packkages: (Run if you know what you are doing ;))
Import-Module Appx
Import-Module Dism
# This will show the installed packages:
Get-AppxPackage | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName
# Remove the package with this command, the package shown in the sysprep log needs to be removed.
Remove-AppxPackage -package <packagefullname>
Now try to run sysprep again. If the “Sysprep is working” pops-up then you are good to go. If you virtual machine is a domain joined machine the machine will leave the domain and is back in workgroup mode.

When sysprep is done the virtual machine will shutdown automatically. Do not start the virtual machine or you need to rerun sysprep 😉
In Prism Central select the template virtual machine and select: Create VM Template

This will show the following wizard:

Give the template a name, description and make a choice about the customization. You can add your own unattend.xml script, create one or just leave it as is. The switch will allow the users (who are using this template in Prism Central) to override the customizations when deploying the template.
Using the template:
We can now use this template to create virtual machines. Select templates from the menu on the left, select the template and the click: Deploy VM. You can also click “Create VM from Template” in the VMs dashboard.

Fill in the information, add a customization script (if needed, and if possible) and click next –> deploy.

A new virtual machine is being created based on your template.
Updating the template:
Now, when you need to update the template with patches or other things go to the templates dashboard in Prism Central and click on the template name.
The following screen will appear. Select: Update Guest OS from

You need to choose the version you new version will be based on. In my case I only have 1 version so I will use that one.

This screen shows, which will help you what to do next. Click on Proceed.

An new, temporary, virtual machine is deployed. You can use that one to updated the required software (or you monthly windows updates). Click on the Close button.

When you are done updating the software, shutdown the machine and do back into the template. (You can reboot the temporary virtual machine if needed for the updates.) You will have a new options in the action menu named: Complete Guest OS update. Select this.

Give the new version and name and fill in the change notes. Select: Yes, set this new version as active. To make it directly available for deployment. Click on “Complete Update”

And there you have it, easy template creation and management in Prism Central.
Hi Jeroen,
Do you know if there are any automation options to update the VM templates with for example Windows Updates?
I’m working on this 😉 But aint got much spare time to finish.