Virtual Lab – Creating Differencing Disks
This is part of my series on building a virtual lab for use with SQL Server and Windows. You can see the entire series here: Building a Virtual Lab with Hyper-V.
The whole point of virtualization is better use of resources. Whether it’s CPU, storage, networking, power, etc., we are trying to save having to purchase 5 or 6 machines and connect them all, pay for them, etc. It’s much, much easier to use virtualization.
This is especially true of storage. When we build a lab, we don’t want to have to allocate a ton of space for our systems. In my case, for my design, this is what I want to end up with.
From my last post, I had the bottom two files already set up. These are my installations of Windows Server 2012 R2 Standard and Core, sysprep’d and ready to use.
Differencing – Saving Space
The idea in differencing disks is similar to the snapshot feature I used in VMWare to do this same process. I take a base disk, and create a “copy” of it. Except the copy doesn’t have everything from the base disk. Like a database snapshot in SQL Server, if I need to read something that’s in the base disk, I reference that. If I change something, or add something, I read from the copy.
As you can see above, I have 5 small disks at 4MB and my 2 large base disks. Each of the small disks is a differencing disk off either the Standard or Core base installations.
I created these by selecting New Hard Disk in Hyper-V Manager
After the intro screen, I make sure I’ve picked VHDX.
At the next screen, I choose the differencing option.
Now I need to pick a location for the copy. On my setup, I’m trying to keep this lab contained, so I have a WS2K12 Lab folder. I choose that as my location for the differencing disk. I give it a name, in my case, I’m using “Function” concatenated with the name of the Windows host. As seen below, my file server will be named “FileAvalanche.vhdx”.
Next I choose the parent disk. this is the base image. Depending on what I had in my design, I choose the Standard or Core images for various machines.
I get a summary where I can see all my options, and then click finish.
I do this five times and all of a sudden I have a lab.
A few things. Use some naming convention so you can tell which disk is which. Also, make sure you stick things in a location. I set a specific folder location for my VMs and disks, and then altered the Hyper-V Manager settings to default to this folder. On my machine that’s D:\Virtual Machines.
That helps me keep things contained, and it also means that when I want to copy a VM for a backup or to another machine, it’s easy.