Hi all, I was asked by a customer recently how to deploy Differencing disks with SCVMM 2012 R2 and I couldn't find as much detail on this as I would have liked, hopefully this Blog will fill in the gaps.

Creating VMs from a Differencing Disk in SCVMM 2012 R2:

There are some changes in SCVMM 2012 R2 that optimise the use of Differencing disks.  In previous versions VMM was not able to manage Differencing disks with any intelligence with regards to deployment and administration.  We can now create a VM Template with a Parent Disk and ensure that all VMs created from that template will generate a new differencing disk.  When a VM using a Differencing disk is migrated, VMM will check to see if the destination Host has a copy of the Parent disk, if it does, only the differencing disk will need to be migrated.

This is great news obviously, but more importantly, I want to show you exactly how to deploy a VM using Differencing Disks so that you can take advantage of this new functionality.

CAVEAT ALERT!  Bear in mind that when it comes to performance, a Differencing disk will not perform as well as a Dynamic or Fixed disk.  Plan to use Differencing disks in your Dev environments where they are great for spinning up a group of VMs quickly and with minimal resource requirements in terms of disk space and time to deploy.

Setting the Placement Path for Parent disks:

First of all, we need to set the default location for Parent disks on all Hosts in the Cluster. This will ensure that whenever we deploy a new Parent disk, it will place it on the path specified (It will also reference this location to look for Parent disks when you deploy VMs that use a Parent disk), you can add multiple paths if you wish to do so. You can use a CSV or an SMB File Share as the destination.  Within the VMM Console, right click on a Host and select Placement Paths...

 

Click Add and select the path… 

Creating the VM Template:

Browse to the Library view, select the option to create a New VM Template, then browse to the VMM Library so that you can select the vhdx file that you want to use as the Parent disk…

Select the disk to be used as the Parent…

Click Next…

Give the Template a Name and Description…  Select the type of VM, in this example I’m using a Generation 2 VM…

Configure the Hardware settings as you require them with the appropriate RAM, Processor etc.  The only important thing to note here in relation to the Differencing disk is that you place a tick in the “Create a differencing disk using the specified disk as the parent”…  This will ensure the disk you selected from the library is used as the default Parent disk for this Template and all VMs that are then created using this Template…

Now add in the OS settings you require…

Add any Application(s) you require…

Click Next…

Click on View Script if you’re interested in what the PowerShell script will be doing…  Then hit Create to complete the process of creating your VM Template…

You’re now ready to deploy a VM with a Parent Disk…

Creating the first Virtual Machine:

This is where we deploy our first VM, there are two scenarios here:

  1. The Default Parent Disk has already been deployed to the Host on the Default Placement Path we specified earlier

  2. The Default Parent Disk has not been deployed to the Host on the Default Placement Path we specified earlier

If 1 is true, the deployment of the VM will recognise that the Parent Disk has already been deployed and will only need to create the differencing disk for the Virtual Machine.

If 2 is true, the deployment of the VM will need to copy the Parent Disk to the Host (using the Placement Path we specified earlier) and then create the VM and the associated differencing disk. (Subsequent deployments will revert to method 1)

 

Deploying a VM using the Differencing disk VM Template:

Go to the VMs & Services window and select Create Virtual Machine…

Browse to the Library to select the VM Template as the source for our new VM…

Select the Template…

Click Next…

Give the VM a name, note this is the not the computer name but the name of the VM as it will appear in VMM…

Ensure the Processor and RAM etc are all configured as required and notice that the disk is already selected, you cannot make any changes but you can add additional disks should you need to…

Configure the OS settings…

Select the Host Group or Cloud you want to deploy to…

Review the placement settings and select the appropriate Host…

This is the interesting part…  As you can see, the VM will be deployed to one of the default VM paths on the Host… in this case it is C:\ClusterStorage\Volume2…

In the Machine Resources section we can see the Deployment details for the Source and Destination Paths for the Differencing disk (notice under Deployment options we see the “Use differencing disk optimizations” preselected).  We also have the option to specify the “Parent disk destination path” or we can “Let VMM decide”…  The only reason you would override VMM is if there were multiple Parent disk paths and you wanted to select a specific path…

As you can see below, I only have one Placement path available for Parent disks so VMM would have chosen this one by default…

Click Next…

Click Create…

You can now monitor the job and see the various steps that are completed as part of the deployment.

 

Now, browsing to the ClusterStorage directory on my Host I can see the path specified for the Parent Disk (C:\ClusterStorage\Volume3) and the path specified for the VM (C:\ClusterStorage\Volume2)…

In Volume3 I can see the Parent disk…

In Volume2 I can see the VM I just created (TESTVM01)…

In the VM directory I can see the Differencing disk which is only 649MB…

When the first VM is created you may notice in the destination directory that an Export folder is created as SCVMM generates the differencing disk…

Now that the Parent disk has been deployed, deploying a new VM should take a matter of seconds…  27 Seconds to be precise… 

Additional Info: 

Best Practice for Differencing Disks - http://technet.microsoft.com/en-us/library/ee941134(v=WS.10).aspx

Overview of Changes to Differencing Disk optimisations in SCVMM 2012 R2 - http://technet.microsoft.com/en-us/library/hh368991.aspx