Virtual PC Management for MS CRM Consultants

The Blab:

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… 

image

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.

image

“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…

  1. 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)image
  2. Double click on “MSCRM 40 2009 Demonstration VPC.part01.exe” to extract its content. When the extraction completes, you will see three files.image 
    “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.

  3. Open Microsoft Virtual PC 2007 SP1.

    image
  4. File | Virtual Disk Wizard
    image
  5. Next | Select “Create a new virtual disk” | Next | Select to create “A virtual hard disk” | NextimageHere 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
               client. 
           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.
  6. Next | select “Differencing” | Nextimage
  7. Browse to the “CRM-SRV-01 2009.vhd” file that we extracted earlier.imageNote: 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.
  8. Finish | Congratulations!!! You have now successfully created a Differencing Disk based on the Microsoft Dynamics CRM VPC Image.image
  9. Now we will create a Virtual Machine based on this Differencing Disk.
    File | New Virtual Machine Wizard.
    image

10. Next | select “Create a virtual machine” | Nextimage 11. Browse to a location and enter the name for the vm | Nextimage      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.image

13. Allocate 2GB of memory to the VM | Nextimage

14.  Select “An existing virtual hard disk” | Nextimage
15. Select the vhd file location, check Enable undo disks | Next.image     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.image

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;

image

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!!!IMG_0245 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!!!

Advertisements

7 responses to this post.

  1. Nice post Sun – and thanks for helping me with this the other week.

    Reply

  2. Posted by Kelvin on January 19, 2010 at 9:29 am

    The external USB HDD may help you to manage the VPCs but speed wise you may not better off. since the internal serial cable is way faster on transferring the data than the external HDD.

    Reply

    • Hi Kelvin, if we are just looking at nothing but the data transfer rate. You are absolutely right. The key message here is to share the load of read disk operations from your internal HD with an USB flash drive.

      A simple test you could do:
      Run up 2 VMs concurrently, everything else being identical:
      Test case 1: Run all VHDs on one single internal HD.
      Test case 2: Run the differencing disks only on your internal HD and the parent VHD on your USB flash drive.

      The difference in performance is very very noticeable.

      The ideal scenario, I think, is to have dual internal SATA HDDs, even better with SSDs and split the disk operations amongst them.

      Reply

  3. Posted by Kelvin on January 21, 2010 at 1:26 pm

    Damn, I didn’t know I could use the differencing disks. Thanks for the tip. I just configured my VPC to use differencing disks. Haven’t got time to compare the performance but it is fantastic for multiple VPC setups. Cheers!

    Reply

  4. Posted by sampath on February 23, 2011 at 6:49 am

    can u please tell me what is the user id and password for sqlser in vpc, i am not able to connect to the sqlserver .

    please it is needfull

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: