Beruflich Dokumente
Kultur Dokumente
Development Environments
Using Differencing Drives
By Reza Alirezaei , MOSS MVP,MCTS
Blog: http://blogs.devhorizon.com/reza
Version : 1.3.0
Introduction ................................................................................................. 3
Background .................................................................................................. 4
Overall Plan .................................................................................................. 5
Differencing drives defined .......................................................................... 6
Creating the baseline image ......................................................................... 7
Creating level1 images based off the baseline image ................................... 9
Creating level2 images based off the level1 images ................................... 16
Procedures for fine tuning your differencing virtual hard disks ................. 19
Troubleshooting Differencing Drives .......................................................... 21
Performance tips for your Virtual Machines .............................................. 22
Additional Resources ................................................................................. 22
Introduction:
There has been always a huge debate over using non- virtualized versus virtualized environments for
SharePoint Development. This always reminds me of a controversial debate about using custom
business objects vs dateset in the past , a debate that has never been an end to it. Pretty much the same
thing happening here, some people are in favor of virtual servers and working in these environment s
and others are in the opposition group. Some of the main criticisms against using virtualized
development environment include:
a) Many organizations set up trusted dev environments based on their own policies and do not
let you plug in your virtualized dev environment or they don't allow the existence of a server
(i.e. your WIN 2003 virtual machine ) hanging loose in their infrastructure for security purposes.
When it comes to virtualization technology , there is yet another difficult decision to make between
VMWare and Virtual Server (or VPC) . Although I can see VMWare more at enterprise level and a very
good candidate for server consolidation and speed, I believe for development purposes nothing can
compete with Virtual Server (or VPC). Its undo (much easier than snapshots in VMWare) and
differencing drives capabilities are just great. Needless to say, virtual Server (or VPC) is a product given
free of charge.
Well, I am focusing on a development platform in this article , but I would also like to draw your
attention to a risk associated with using VMWare at enterprise level . It is the level of support that you
may get from Microsoft. I have experienced MS support implications for customers who run their
SharePoint platform on VMWare , even for premier type of supports. I would highly recommend that
you consult your Microsoft representative before taking any chances in regards to choosing VMWare as
your main virtualization platform for SharePoint either for development purposes or at the enterprise
level. You don't want to take any chances and face difficulties should an issue occur during the life cycle
of your SharePoint projects.
Using differencing drives on the top of virtualization technology even adds more value :
Important I haven't seen a need for non-virtualized environment for my clients ,but it doesn't mean
that I am suggesting you to completely ignore it. In this article I am just sharing the idea based on which
I build my SharePoint development environments that may not be suitable for an specific project or a
client of yours. Needless to say , in my literature there is NOT a single solution that fits all, so it is always
evaluate all your options and decide accordingly based on your own project requirements.
As for development environment matters , I have always been able to convince my clients to allow me
to work in the environment that I think is suitable for my project s, not the environment that someone
else with no or minimal development experience dictates to me. The truth is , there were a few
incidents in which I was unable to sell my desirable working conditions ,but I managed to work out
something that was finally led to something close to what I had in mind at first place. Quite frankly, I
never develop on XP or Vista (even for my non-SharePoint projects ), because If there is the option for
developing on the most stable operating system ever (WIN 2003/2008)and when this is the environment
Adequate memory and disk space is also not expensive these days , so I would argue this as a limitation
for developing in virtualized environments. Having said all this, I strongly believe in setting up my
SharePoint development environment based on the virtualization technology and using differencing
drives in particular. okay, it is time to build this environment, so let's get started.
Overall Plan:
The overall plan is to create a baseline image as the core virtual machine(WIN2k3_Base) . MossDiff
machine and WssDiff machine are created using differencing drives and they are meant to be core
virtual machines for all WSS and MOSS virtual machines. MossSandBox machine , which is also built
using differencing drive, is derived from MossDiff and WSSSandBox machine is derived from WssDiff.
We will only use the last two virtual machines and we will write-protect or lock all the other three
machines (WIN2k3_Base, WssDiff,MossDiff). I will walk you through this process later in this paper.
Overall Plan
For brevity , I'll skip the steps required to create baseline image , but it is called Win2k3_base and I've
placed it in F:\LiveVMs\sysPBase folder as shown in figure 2.
Okay, now the question is how to create these two machines. First let's start with WSS machine.
Figure 3
Figure 4
Figure 5
a. Performance -->Settings --> Performance Options -->Data Execution Prevention --> Turn
on for selected programs .
b. Environment Variables --> System Variables --> Path --> Place the BIN folder of 12 Hive
here (i.e. C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\BIN).
c. If you are using more than one network cards in your host OS , try to load balance your
virtual machines on them. Don't put all the pressure on one network card only.
d. If you are planning to boot up more than one virtual machine at a time, try to distribute
your vhds on different hard disks evenly. For more information please see section " Start
virtual computers serially, not in parallel" later in this paper.
3. Follow step 1 to step 8 for the other machine (MossDiff) customized for your MOSS
development works.
4. Once you are done setting up MossDiff virtual machine , you need to write-protect or lock the
WIN2k3_Base image to prevent data loss. For more information please see section "Differencing
drive reports that its parent has changed" later in this paper.
a. Remove WIN2k3_Base virtual machine from Virtual Server Admin console. Don't worry ,
this will not delete the actual vhd and vmc files.
b. Make vhd file read only and change the extension of vmc file to something meaningful
as shown in figure 9 below.
Figure 10
There are couple important notes here that I would like to draw your attention to:
1. When you are done with your WssSandBox and MossSandbox , you have to go through the
same write-protection process stated in step 10 above for WssDiff and MossDiff images. It is
very important to do this , otherwise you may have some problems later on.
2. Make sure you enable Undo Disk feature when creating WssSandBox and MossSandbox.
Remember that we didn't need this option in base images as we were not going to change those
machine. Those machines are only meant to serve as a core platform to build our customer-
specific or project-specific virtual machines. When using undo drive, all the changes are written
to the undo drive and the differencing drive is left untouched. When you shut down the virtual
computer, you have the option to persist those changes you have made in your sandboxes or
not. This is a perfect option for a sandbox environment.
3. As you might have noticed by now, this solution is not good for a farm installation. It is good for
stand-alone development environments that you only bring one machine up at a time. My
experience tell s me that most of developers' computers do not have the power to boot up
more than one virtual machines at a time, so this solution assumes that you only have one
machine boot up at a time. This doesn't mean that you cannot branch out other sandboxes off
the WssDiff or MossDiff core machine,but you are limited to have one branch running at the
time. If you can't live with this limitation , then read the solution below.
4. If you ever need to boot up two machines , derived from the same base image , then you need
to follow these steps:
a. Boot up the machine without Network capability.
b. Apply a new SID (Or SysPrep). This makes sure that there is no SID collision in DHCP or
any other OS unique settings that cannot be replicated.
c. Reboot the machine.
d. Reconnect the machine to the network of your choice. Figure 12 shows that how I have
been able to start 3 machines derived from the same core image (WIN2k3_base) up and
running without any problems.
e. If you are planning to boot up more than one virtual machine at a time, you have to
actively monitor and adjust the settings in CPU Resource Allocation (Figure 12) to
ensure you have the optimum configuration for your virtual machines
Figure 13
Important Before optimizing any virtual hard disk it is best to make a back-up of it and do not perform
these tasks with undo drives enabled.
Note The WindowsUpdate folder is a Hidden folder. You must therefore chose to display hidden
and system folders in order to perform this step.
4. Select all of the files and folders in this folder and delete them
Note Other log files will be present in the virtual computer as some logs are created automatically
when the virtual computer is running.
The only way to determine the severity of the problem is to allow the virtual computer to continue to
boot. If the virtual computer completely boots, and you are able to logon to the virtual computer
without error, then the parent virtual disk is fine and you don’t need to take any further action.
However, if an error occurs during boot and/or logon you should replace the base virtual disk with the
one that you originally created and hopefully backup somewhere for future references.
The more serious form of this error occurs when you open the base virtual disk directly without the use
of a differencing drive. You must not do this as it may cause a corruption to the virtual computer that is
based on the parent/differencing drive combination.
When the error message occurs erroneously it is most likely related to a problem that occurs when the
virtual hard disk is extracted from an archive. In some cases the virtual hard disk date time stamp is
incremented by one second when it is extracted from an archive. The differencing drive stores the date
time stamp of the parent disk in its header and checks it against the actual date time stamp of the
parent disk file. The difference of one second between the stored date time and the actual date time
causes this error to be displayed, and in this case it is completely harmless.
If, after opening the virtual computer, you save the differencing/parent virtual disk combination you will
never see the error again as the date/time stamp is updated in the differencing disk.
By starting one virtual computer and then starting another one after the first has reached the logon
screen you allow each virtual machine exclusive access to the disk and it will take less time to start the
virtual computers.
Additional Resources:
1. Andrew Connell has posted a great article on virtual machines using differencing drives .
2. Virtual Machine best practices on TechNet .