In my previous post, I did mentioned about creating templates – how ever it was for Gen1 servers. With Windows Server 2012 R2, We have a new generation of VM – AKA Gen2.
Today I would like to give a brief on how to create a Gen2 Template. Usually, I follow the traditional method of building a VM on the Hyper-V host and prepare it for becoming a template. As we did the template creation for Gen1 VM, The whole process is divided into three stages.
The first stage is to prepare a VM for the template.
- Create a Gen 2 VM – I will name it as Golden Image
- Windows Patch Updates
- Install HyperV Integration Component
- Antivirus/Agents or any of the custom software required on all servers deployed using this image
- Enable RDP
- Disable Firewall
- Set Administrator password blank
- Export the VM – This is required if we need to update template on a later stage
- SysPrep and Shutdown
The second stage is to configure the per-requisites on Hyper-V for template / deployment using template.
- Run As account for Local Administrator – Create if not created already.
- Run As account to be used with ADJoin which has the rights to Join Computers on AD – Create if not created already.
- Gust OS Profile – Create only if not already created.
- Create Gen2 Hardware Profiles
In this second stage, Run As Account and Gust OS profile can be the same which was created for a Gen1 VM. How ever, we need to have a Gen2 Hardware profile created. As you know, the architecture itself is different between a Gen1 and Gen2 VM. Hence, Its important to have a Hardware Profile created for Gen2 Server. As all other steps are similar, I will only walk through this now.
Navigate to SCVMM -> Library -> Profiles -> Hardware Profiles
Create a new Hardware Profile
On the General Page, Enter the Profile Name
Make sure Generation is selected as Gen 2.
Configure the Hardware components as per your requirement.
On the Firmware page, Enable Secure Boot should be checked (By default, its checked. Don’t uncheck it).
And that’s it. We have the Hardware profile for Gen2 VM. Now we are ready for stage 3 which is the template creation.
In the Third Stage, I assume that we have a Gen2 VM which is prepared with SysPrep.
Navigate to SCVMM -> VMs and Services -> All Hosts
Identify the Golden Image VM which we created and performed SYSPREP.
Right Click on the VM and select Properties.
Ensure that the Operating System and Integration Service is properly updated in SCVMM.
If Operating System is displayed as unknown, Select the right Operating system and Click on OK.
Few experts has mentioned that we need to enable the check mark for “Contains the Operating system for the virtual machine”. Logically its correct and hence I too did that. Don’t ask my if its mandatory.
Thats it. We are ready to create the template.
Right Click on the VM and Select Create -> Create VM Template
Read the warning and click on OK.
On the Hardware Configuration, Just click next.
On the Operating System configuration, Select the appropriate Gust OS Profile.
Select the VMM Library Server
Select the path where you need to store this on Library. I will usually put under the Templates folders inside. You can even create a folder structure as you wish.
Review the summary and click on Finish.
Once the template is created, create a new VM.
Select the template and click on OK.
Click next to proceed.
On the Configure Hardware Profile, Select the Gen2 Hardware profile we just created.
On the Gust OS Profile, Select the appropriate GUST OS Profile.
And proceed with the next steps what we did for a Gen1 VM creation.