Email This List Email This List Print This List Print This List

How to cre­ate a VM Tem­plate with Hyper‑V

Microsoft Hyper‑V lacks the cap­ab­il­ity to cre­ate and man­age tem­plates and this can be trouble­some for IT spe­cial­ists requir­ing to deploy a large num­ber of identic­al vir­tu­al machines. A time-con­sum­ing task that could be much more effi­cient and simple.

To save your time, we sug­gest the fol­low­ing meth­od­o­logy that is more sim­il­ar to a work-around. You will be able to deploy sev­er­al vir­tu­al machines without much effort but it will still be dif­fi­cult to deploy hun­dreds (or worst thou­sands) of them.

The first step is to pre­pare a vir­tu­al machine that will become the tem­plate. In our example, we used aWin­dows Serv­er 2012 R2 VM. Install the oper­at­ing sys­tem, pre­parare the applic­a­tion and then nav­ig­ate the path C:WindowsSystem32Sysprep. Inside the folder you will find the execut­able Sysprep.exe, run it and con­fig­ure as fol­low­ing. Sys­prep is a Microsoft tool that allows to pre­prare a Win­dows install­a­tion to be cloned /​ duplic­ated:

Prepare the VM and run Sysprep

Now that the vir­tu­al machine is ready and switched off, let’s go to the hyper­visor. Select the VM and export it:

Export the virtual machine / template

Cre­ate a folder where to store the tem­plate:

Save the template VM

We are ready for the second part of the tutori­al, the deploy phase. Cre­ate a new vir­tu­al machine:

Create a new virtual machine

At the Con­nect Vir­tu­al Hard Disk tab, select Attach a vir­tu­al hard disk later:

Select "Attach a virtual disk later"

Let’s cre­ate a copy of the stored tem­plate. In our example, we left the file in the same folder of the tem­plate but we sug­gest to copy it inside the folder of the newly cre­ated VM:

Copy the template and rename it

Edit the Set­tings of the newly cre­ated VM and add a HD:

Select the copy of the template as the virtual disk

Select the path of the copied vir­tu­al disk and Apply:

Apply and you will be ready to use your new machine

You’re ready to start the new VM. Repeat the oper­a­tion to deploy oth­er vir­tu­al machines.

admin has written 133 articles