+ All Categories
Home > Technology > What’s The Difference? Creating Parent and Differencing VHDs Through Hyper-V

What’s The Difference? Creating Parent and Differencing VHDs Through Hyper-V

Date post: 24-Jan-2017
Category:
Upload: carl-boisson
View: 37 times
Download: 2 times
Share this document with a friend
9
Carl Boisson Mar 29 · 6 min read
Transcript

Carl BoissonMar 29 · 6 min read

What’s The Diµerence? Creating Parent andDiµerencing VHDs Through Hyper-Visor

The VHD Age

Image credit: Carl Boisson

The VHD AgeWhen Microsoft created the .VHD format, they streamlined the process ofmanaging storage in environments that have become increasingly virtualized.Virtual Hard Disks (VHD) are logical representations of storage that can bemanipulated in a similar fashion to real disks. Blank VHDs can be created foruse as storage spaces for Virtual Machines (VMs), or they can be preloadedwith Operating Systems (OS) and used to run those VMs themselves. VHDsare also highly portable as admins can easily transfer them over theirnetworks without having to physically remove disk drives.

While VHDs allow for greater flexibility in storage management, their ease ofcreation can accelerate capacity loss. For example, within minutes anadministrator can create 8 VHDs preloaded with Windows Server 2012. Ifeach VHD is 8GB, that would be a total of 64GB! In the real world, thisexample is repeated many times over. This can greatly increase storage costsas additional hardware would be required to meet capacity needs.

Increased portability also comes at a cost. VHDs, specifically dynamicallyexpanding ones, can easily swell in size, especially if they’re loaded with anOS. Transferring these large files over a network can increase traffic and drainbandwidth. Microsoft has found a novel way to dress both of these concernswithout affecting VHD functionality.

A Vast DiµerenceSysadmins can now use differencing disks to minimize the footprint ofVHDs on drives and conserve bandwidth. These are special VHDs that share aspecial Parent/Child relationship with regular VHDs. A Parent VHD containsall the raw data (OS, software, files) that an admin wants to be “reproduced”in the differencing disk(s). The differencing disks “pull” the shared data fromthe parent, and the only data written to the “child” VHD file are changes thatdiffer from the parent (hence, the name).

Because the resulting VHD file only contains differencing data, the result is afile that’s a fraction of the size of the parent disk. Take our 8 VHDs from ourprior example, then totaling to 64GB. Now they would come in at little over1MB if they were created as differencing disks with the same Parent.

Often, network administrators are moving VHDs across intranets and theinternet. Differencing disks are smaller files which are easier to transfer overnetworks. This reduces transfer times and costs associated with mitigatingbandwidth blockages.

Do It Like Disk

Do It Like Disk

1 . Organization*In order to keep track of your VHDs, it is best practice to make your folder(directory) hierarchies and names consistent with the purpose of each disk.For example, adding “parent” or “base” to the file name of the parent VHD. Ialso recommend separating the parent VHD from the differencing disk.

**Note: If data on a parent disk is altered in any way, it will be reflected in allthe differencing disks created from that parent. This is akin to changing theirDNA as all “child” disks share the same core data (see intro image). This mayresult in having to run sysprep many, many, many times.**

2. Preparing the Parent DiskSysprep is a command line tool which reverts a running operating system toan out-of-box state by generalizing uniquely identifying data. This includesuser accounts and Security ID numbers (a SID can be likened to a socialsecurity number for computers). Depending on the source of the VHD youintend to use as the parent, this step may not be necessary. For example, if youdownloaded a Server 2012 VHD directly from Microsoft, you can move on tothe next step. However, if you’re unsure and you skip this step, you may endup having to run sysprep many, many, many times. If performed successfully,a VM created with a differencing disk from this parent will start with an out-of-box experience. This ensures that identifying attributes, such as SIDs, willnot be duplicated.

Parent and diÓerencing disks should have their own folder

The names of the Ûles should reÞect their purpose

Create a new VM and use the desired parent VHD as its disk, run it and then:

Run Command Prompt

Type: cd C:\Windows\system32\sysprep(where “C:” is your OS directory)Press Enter

Type: sysprepPress Enter(this will start sysprep.exe)

Select “Enter System Out-of-Box Experience (OOBE)”

Check “Generalize”

Select “Shutdown”

Click “OK”

Ensure the VM is shut down.•

Make sure “Generalize” is checked

It may take a while

3. Create the Diµerencing DiskUsing Hyper-V (the same program used to create and manage VMs):

Click New > Select “Hard Disk…”

Select “VHD” > Click Next(the format must match the parent)

VM in the OFF state

Select “Differencing” > Click Next

Type the desired name* of the differencing disk

Browse to the desired directory* > Click Next

Browse to the Parent VHD > Click Next

Remember, stay organized

Click Next > Click Finish (repeat for each disk)

4. Veri½cationYou can test drive your new differencing disks by creating VMs with them asthe disk. You can also use Hyper-V to inspect the disks and verify the path tothe parent.

Click Inspect

Browse to differencing disk

A set of Á diÓerencing disks from º parent. Note the small Ûle sizes.

What A Diµerence A Disk Makes!Now you’re well on your way to impressing your employers by setting updifferencing disks to save time (bandwidth) and money (storage costs). Ifyou’d like some learn more about differencing disks or VHDs in general, checkout the links below. Thanks for reading!

Additional Resources:Using differencing disks | Virtual Storage Explained | Storage Pools Guide

Key Terms:BandwidthDifferencing diskDynamic diskLogical diskInternetIntranetNetwork trafficOperating systemSIDStorage spacesSysprepVirtualizationWindows Server 2012

Disk properties point to parent disks


Recommended