AskME4Tech

We Do the best to understand Technology

You are here:

How to use differencing Disks in HYPER-V

Differencing Disk is good solution to save hard disk space in your HYPER-V Host when you must deploy multiple Virtual Machines in your environment for test purposes. Of course you can use it in your production environment but you must sure that the Parent Hard disk located in Disk with high performance like SSD because the I/O will be high. 

Differencing Disks can reduce the time and storage requirements but if you use lot of child disks can be a performance hit.  So think very carefully where and why must use Difference disks in your environment.

What is differencing disk

A differencing disk is a virtual hard disk (vhd) or VHDX which store changes made to another vhd or to guest operating system. A differencing disk associated with another disk. So when must be create a differencing disk the associated disk must be created first. The virtual hard disk is called parent disk and the differencing disk called child disk.

The differencing disk expands dynamically and can grow as large as the maximum size allocated for the parent disk.

Except from the storage requirement which is a big advantage differencing disk can use it to isolate changes and reverse them.

With a simple words you can create one parent disk with OS including patches,updates and any software that you want and base on the parent disk you can create child disk for every VM that will keep only the changes between the parent -< - >child disk. Below i will try to visualize what i am say.

Below i will explain how can create and use the differencing disk. 

So let's start.

Create new Virtual Machine

First of all you we must create a new Virtual Machine in HYPER-V and install the OS , patches, updates and any software that you want. For the scenario i will install only the Windows OS with the latest patches and updates.

Find instructions in the article how can create the new Virtual Machine

Create Virtual Machine in Windows 8.1 with HYPER-V

After finish with the create of the new Virtual Machine must do the Virtual Hard Disk Read Only because if the parent hard disk modified from any process or anything else then all Differencing hard disks related to this parent disk will become invalid.

  • Open the path whitch located the Virtual Hard disk
  • Right Click in the virtual hard disk. Select Properties and check the Read Only. Click OK.

Run Sysprep in Virtual Machine

After have create the new Virtual Machine and have finish with all the installations now it's time to run sysprep. We will run Sysprep to generalize the Virtual Machine and use the VHD or VHDX to create multiples Virtual Machines.

Because we have to do with Virtual Machines you can use Sysprep with the switch /mode:vm. This command can apply after Windows 8.1 and Windows Server 2012. It's a new command and you can't use it before Windows Server 2012 or 8.1.

Find the article with the instruction how can proceed to run Sysprep /mode:vm

Windows Sysprep Tool for Virtual Machines

 

Create new Differencing Disk

After Sysprep run successful now it's time to create a new virtual hard disk as differencing.

  • Open Hyperv Manager
  • From the right side select New ---> Hard Disk
  • In the first screen Click Next​

  • Select the Disk Format VHD or VHDX. For the scenario we proceed with VHDX. Click Next. But the Disk Format must be the same as the parent hard disk which create before with the Virtual Machine in Create new Virtual Machine.

  • The Disk type that must be select is Differencing.

  • Write the name that you want to have the virtual hard disk. I change the name to child1. Select the path that will save the hard disk.Click Next.

  • Browse and find the parent hard disk that we create in  first step Create new Virtual Machine. Click Next.

  • Just a Summary. Click Finish to create the new Virtual Hard Disk.

 

Create new Virtual Machine to use the Differencing Disk.

We have create the Differencing hard disk. Now it's time to create the new Virtual Machine.

  • Open Hyperv Manager
  • From the right side select New ---> Virtual Machine
  • In the first screen Click Next.

  • Give a name for the Virtual Machine and select where will save it. Click Next.

  • Select the Generation. You will select the same Generation that have select in the beginning when create the new Virtual Machine with the parent hard disk. Click Next.

  • Give Memory of your Virtual Machine. For now 2 GB is ok.

  • Select the Virtual Switch to use the specific Virtual Machine. I select Not Connected for Now. Click Next

  • Select Use an existing Virtual Hard Disk and find the Differencing disk which created before. Click Next.

  • Just a Summary. Click Finish to create the New Virtual Machine.

  • Start the new Virtual Machine to check if all workings well.

 

Differencing hard disks can make your VM deployment less tedious and repetitive and it's a very good solution when you want to isolate changes and reverse them quickly. Can reduce lot of time, lot of storage requirements but you must very careful when will take the decision to use it in your production environment because parent disk can be a bottleneck of your Virtual Machines. The best solution is to use SAS Disks for the parent disk to avoid performance issues.

I hope to find interesting my article.

Now it's your turn to tell us what is your experience with Differencing Disks or give a try and come back with your feedback in our commented system.

Have a nice weekend.

 

Similar Posts

HYPER-V - How to Access Virtual Disk Properties

As IT Pro very often  create new Virtual Machines for Production Enviroment or for Testing.

Create and Configure Virtual Machine with PowerShell

 

Keep in Touch with Askme4Tech

Twitter icon
Facebook icon
Google+ icon