I don’t particularly enjoy being deprived of sleep, and things like attending a live LiveMeeting session running 9:00AM – 10:00AM on Pacific Time (meaning waking up at 3:00AM on our NZ Time) doesn’t really appeal to me a great deal.
NEVER FEAR, MY FELLOW COMRADES!!!
– Long live LiveMeeting On-Demand!!! 🙂
So, I was watching a MSFT Partner on-demand LiveMeeting training “Launching Your Microsoft Dynamics™ CRM Practice: Tools for Microsoft Dynamics™ CRM Consultants” hosted by Val Draper, a CRM PTS out from the States somewhere.
Ok, getting to my point of this post. There was a few polling questions Val started his session on, one was “Do you use Differencing disks on the Microsoft Dynamics CRM VPC image”. I was in complete AWE when I heard what the response was – “100% of the attendants are NOT using differencing disks” and these are MSFT Gold partners around the globe we are talking about here…
In this post, I write about what differencing disks are, why I use differencing disks and how I use it with Microsoft Dynamics CRM VPC Image.
Issue #1: “I need more disk space for my VPCs!!!”
I’m a MSCRM Specialist and I work with different clients on their MSCRM implementations day in and day out. Just like most(?) other MSCRM Specialists out there, I do ANYTHING and EVERYTHING in the Microsoft Dynamics CRM VPC Image. If it had a 2 bedrooms apartment with a heat pump and a sea view, I’d live in it.
The two OOTB .VHD files come with this VPC image are 15.6 GB in size. Imagine I get pimped out to work on 15+ clients’ implementations over a course of 6 months time (which is insanely realistic). To keep different clients IP (customisations, codes, third party add-ons etc) separate from each other, I’ll need to have 15 copies of the VPC image on my laptop.
So Let me pull up the calculator: 15.6 GB x 15 = 234 GB and let’s assume client specific changes we make are 3GB each 3GB x 15 = 45GB. All up I need 234GB + 45GB = 279GB of disk space just for my VPC storage.
Soon I’ll be crying out loud for more disk space…
Introducing Microsoft Virtual PC Differencing Disks
This is a really simple concept, a differencing disk is simply a VHD file that’s created based on another VHD file. Let’s call this base VHD “Parent VHD” and the differencing disk “Child VHD” for the moment and they work like this,
1. A “Child VHD” can be created with Virtual Disk Wizard in Microsoft Virtual PC using “mouse-point-and-click”, the “Child VHD” keeps a reference to “Parent VHD”.
2. When we create a Virtual Machine using Microsoft VPC, we can directly point the VM to the “Child VHD”. So in the VMC file there is no reference to the “Parent VHD”.
3. When we commit “Saved states” (a.k.a. any changes we made to a VM) to Hard Disk, it is saved to the “Child VHD” instead of “Parent VHD”. We essentially write all the differences we made to the Child VHD, hence the name “differencing disk”.
4. “Parent VHD” file can be and should be permanently marked “Read Only” via file properties at OS level. (explained further down this post)
How is differencing disk helping us with VPC disk spaces?
In our context, the “Parent VHD” is the “CRM-SRV-01 2009.vhd” that comes Microsoft Dynamics CRM VPC Image, and I create a child VHD for each of the 15 clients I have. Since we are not writing our changes to the “Parent VHD”, it remains client independent. Therefore, we can share this parent VHD across all of our clients, and assuming that our client “Child VHD” are 3 GB on average as well. Which means I only need 3GB x 15 + 15.6GB x (15 – 14) = 60.6GB of disk space comparing to 279 GB. This is a total saving of 279GB – 60.6GB = 218.4GB and 78.3% (218.4/ 279) of disk space comparing the the previous approach.
“So, how exactly do I create a Differencing Disk for MS CRM VPC Image” – I hear you ask?
Here is a step to step instructions on the HOW-TO…
- Download Microsoft Dynamics CRM 4.0 Virtual PC Image (April 2009).
(*Note: you will need to have MBS Partner access, this image expires on 12/08/2010)
- Double click on “MSCRM 40 2009 Demonstration VPC.part01.exe” to extract its content. When the extraction completes, you will see three files.
“CRM-SRV-01 2009.vmc” – Fist thing to do is to delete this file, because, this is the VM that directly references the “Parent VHD” (CRM-SRV-012009.vhd). This is not what we want. What we want is to create a “Child VHD” (Differencing Disk) that reference this “Parent VHD”, THEN, create a VM (a vmc file) based on the “Child VHD”.
“CRM-SRV-012009.vhd” – This is our main guy, it contains the Operating System, all software installed etc. This will be the “Parent VHD” for our clients Differencing Disks. You notice that I’ve made this file read only. This is because if I make changes to this file after creating Differencing Disks based on it, the Differencing Disks will become invalid.
”CRM-SRV-01 2009 Extrax v1.vhd” – This vhd contains a whole bunch of additional utilities like the accelerators etc. When mounted to a VM, this shows as a separate drive.
- Open Microsoft Virtual PC 2007 SP1.
- File | Virtual Disk Wizard
- Next | Select “Create a new virtual disk” | Next | Select to create “A virtual hard disk” | NextHere are a few rationales that I chose the above location for this differencing disk;
a. I store all my client project work under %Drive%:\Projects\
b. I name the folder the client’s name – in this case, I have “Client 15”
c. I explicitly name the differencing disk “client name” + Diff
Disk.vhd, so that even if it does get out of the folder context I know
exactly what it is for. I sometime add the “project name” to it too
if there are more than one crm project going on with one particular
d. The reason I don’t include the “Parent VHD” name in this diff name is
because, when I do get to created a new VM based on this Diff Disk,
and it loses its references to the “Parent VHD”, it will show me the
Parent VHD’s name and ask me to link to it.
- Next | select “Differencing” | Next
- Browse to the “CRM-SRV-01 2009.vhd” file that we extracted earlier.Note: It warms us that we shouldn’t do any changes to this parent vhd. This
is why I made it read only in step 2.
- Finish | Congratulations!!! You have now successfully created a Differencing Disk based on the Microsoft Dynamics CRM VPC Image.
- Now we will create a Virtual Machine based on this Differencing Disk.
File | New Virtual Machine Wizard.
10. Next | select “Create a virtual machine” | Next 11. Browse to a location and enter the name for the vm | Next Note: I personally prefer to store the vmc files alongside referenced vhd file.
In this case, it’s %Drive%”:\Projects\Client 15\Client 15.vmc
12. Select Windows Server 2003 for OS as is the Microsoft Dynamics CRM 4.0
Virtual PC Image (April 2009) | Next.
13. Allocate 2GB of memory to the VM | Next
14. Select “An existing virtual hard disk” | Next
15. Select the vhd file location, check Enable undo disks | Next. Note: This is the differencing disk we created earlier, the “Child VHD”.
I always check Enable undo disks, I think it should default to checked.
16. Finish | Woila!!! You have successfully create a Virtual Machine that’s based
a differencing disk! and you can go about using the newly created VM.
Issue #2: “My VM is running too slow, how can I improve its performance?”
One other benefit of using difference disks, apart from saving disk space, is it can greatly improve your VM performance by running the Base (parent) VHD on a separate physical disk (not just separate disk partitions), yet better, run it on a USB stick or a separate Solid State Drive (SSD). Here are the reasons;
1. By creating a differencing disk, we are introducing an additional file for Virtual
PC Process to perform Disk Operations on. This is on top of the Parent VHD
and the saved states files. So, having the Parent VHD separate from the
Differencing Disk and saved states files on a different physical disk, we are
offloading competing Disk Operations on one single disk.
2. This Parent VHD is read only and we are only doing ONLY Read Disk Operation
on it, SSDs and USB drives are fantastic in performing read disk operations.
(and shit in doing writes). So the set up is illustrated in the diagram below;
3. Taking this setup one step further, I have these 32GB USB drives, I put two
different Parents.vhd files on them, create two diff disks and two VMs pointing
to each of them respectively, give them 1.5 GB of RAM each, leaving 1GB of my
Windows 7 64 bit host OS. AND run two VMs on one single laptop!!! It works
like a charm!!! If you are really up to it and have these 8GB onboard RAM laptops lying around, you can try to run 3 VMs at the same time, give them 2GB each and see how they go 🙂
TO SUM UP:
1. As a CRM Specialist, we have multiple VMs catering for different clients.
Differencing Disk is a very space efficient approach to manage these VMs.
2. You can host the base Microsoft Dynamics CRM VPC VHD on a USB drive for
your VMs to improve their performance.
3. You can take this concept one step further and run two VMs (perhaps more if
you have one of those 8GB RAM laptops) at the same time without taking much
toll on the performance.
4. These concepts don’t just apply to CRM peeps, it really applies to anyone that
use multiple VMs, check out Andrew Connell, a SharePoint MVP, a virtualization
maniac, how he has taken SharePoint development VMs to the extreme.
Happy VM’ing everyone!!!