Quickly deploying VMs using a template
Creating new virtual machines in Hyper-V is a relatively simple and automatable process, however the installation of an operating system on the VM can still take an extended period of time. Existing automated deployment tools help in the installation process, but most are slow and can be improved in a virtual environment.
Getting ready
In this recipe we will be using a VM with a basic installation of Server 2012 named Server2012_template
:
Create a new VM using the steps in the Creating virtual machines recipe.
Install the Windows operating system on the new VM.
Execute
C:\Windows\System32\Sysprep\Sysprep.exe
.Select Enter System Out-of-Box Experience (OOBE), Generalize, and Shutdown:
Click on OK to reconfigure and switch off the VM.
How to do it...
Complete the following steps to deploy a VM from the template:
Open PowerShell and create the new
VHDx
file:New-VHD -ComputerName HV01 ` -ParentPath 'E:\vm\Virtual Hard Disks\Server8_template.vhdx' ` -Path 'E:\vm\Virtual...