How to Create a Hyper-V Template for Deployment
If you ever need to deploy Virtual Machines often a great time saving way is to create a VM Template for quick and easy deployment.
VM templates give you the advantage of a consistent configuration that is standardised format that is reusable.
To create a Hyper-V VM Template follow these steps;
Create Virtual Machine Wizard
Now we need to give the VM a name and description. In this example I am using the Windows 2012 R2 operating system so the name and description are shown as such. As the Hyper-V host is Windows 2012 R2 as well, I can choose either Generation 1 or Generation 2 VM. Generation 2 VMs add the following new functionality;
- PXE boot by using a standard network adapter
- Boot from a SCSI virtual hard disk
- Boot from a SCSI virtual DVD
- Secure Boot (enabled by default)
- UEFI firmware support
Power On the Hyper-V Template
Now that the VM has powered off, we need to convert it to a template. Highlight the powered off VM, right click and then Create and Create VM template to start the wizard.
Hyper-V Template Creation Warning
Next a warning is shown that you are about to convert this VM to a template. “Creating a template will destroy the source virtual machine “vm name“. The virtual hard disk of the virtual machine will be generalized to create the new template and any user data of the virtual machine may be lost. To prevent this, you can create a clone of “vm name” before using it to create a template.
Make sure you understand what you are committing this VM to and click Yes to continue.
Create Hyper-V Template Wizard Starts
Now the Create VM Template Wizard starts. Give the template a name and description then click Next.
Confirm Template Hardware Configuration
Check you are happy with the hardware configuration then click Next.
Configure Operating System Settings
The Configure Operating System Tab we can change settings for the OS. Time Zones, whether you wish it to join a domain automatically or not, and any additional Operating System Roles or Features you wish can be configured here. Change what you need and then click Next.
Choose a Server Library
On the Select Library Server tab, choose one of your library servers and choose Next.
Choose a Server Library
Finally, on the Summary Tab, you can view the script details to see the settings you have chosen. Confirm you are happy with the settings then click on Create.
Thats all there is to it. Your SCVMM and Hyper-V environment should now be preparing the selected VM and converting it to a template for consistent deployment to your virtual environment.