Select Page

This is actually a repost. This post actually appeared first in my older blog (now defunct). I was playing with VMWare Server back then. Still am, but not too much these days. Been wanting to expand on this posting, just didn’t have the time. So here it is again, my venture into clustering with VMWare Server.

Among the many benefits of having VMWare Server is, it allows you to create a test environment without the need to actually have the required hardware physically – virtualization. Take my case as an example. I have a need to test out an environment where I have a two node clustered SQL Server. Now, without VMWare Server, or any other virtualization software, I would need to have at least 2 cluster capable server hardware. That’s not cheap. So, with virtualization softwares like VMWare Server, I can just configure two cluster capable virtual machines and test out the solution. I can even create another virtual machine to run the required Active Directory services for clustering. In the end, I can run 3 different virtual machines within one physical server. Of course, the server these three VMs are running in would require a lot of resources.

The one I have right now is a HP mobile workstation with an Intel Centrino Duo, 2GB of memory, and 90GB disk space. I would have preferred to have at least a quad core CPU. Oh well, we can’t really have it all can we.

So, what’s required to run a clustered SQL Server in a virtual environment? Well,

  1. A host that’s capable of running 3 VMs concurrently – lots of RAM and disk space
  2. A virtualization software – I prefer VMWare Server (it’s also FREE)
  3. A Windows 2003 Enterprise CD
  4. A SQL Server 2000 Enterprise CD (SQL 2005 can also be used)

Ok, now that you’ve got the above pieces of hardware and software, time to do the actual work. Of course, the first thing to do is to install VMWare Server into your host machine.

Now, we need to configure 3 virtual machines to run Windows 2003 Enterprise. The easiest way of doing this would be to find an already existing Windows 2003 Enterprise virtual machine of the net (if you can find one). If you can’t, don’t fret. You don’t really have to perform the installation 3 times. All you really need to do is to configure and install one Windows 2003 Enterprise VM. Once you’ve installed, configured and updated the Win2K3 VM, run sysprep on it.

After you’ve run sysprep, you can then just copy and paste the entire machine into a different directory and you’ve got yourself another copy of Windows 2003 Enterprise VM ready to run. All you need to do after that is just register the new VM into VMWare Server, make any specific modification to the VM you require, and it’s all set to run. Simple. Here’s my VM cluster folder structure:

VMWare Server

Note: You don’t need sysprep if you plan to run the VMs independantly. Sysprep is important if you plan to run clusters and Active Directory. It ensures that the machines have unique SID. Otherwise, you’ll face problems with domain trusts and what nots.

You now have the means to quickly install Windows 2003 Enterprise in your VMs. So, back to running a clustered Windows 2003 in VMWare. You need to configure 2 VMs with cluster capable hardware. My cluster VMs are W2K3E.CL1 and W2K3E.CL2. W2K3E.DC is the Active Directory server for my cluster domain. Just configure 2 VMs as you normally would, then add a few more additional items. The additional hardware required for clustering:

  • Quorum Disk – Used by the cluster to store cluster information.
  • Data Disk – The shared disk storage used by the clustered application.
  • Ethernet – One Ethernet specifically for cluster heartbeat

VMWare Cluster

The image shows my VM’s hardware configuration. Note that the two disks – Quorum and Data must be SCSI disks. They should also be configured on a separate SCSI controler than your system disk. SCSI0:0 is my system disk. SCSI1:0 and SCSI1:1 are my Quorum and Data Disks respectively. These two disks are created in the SharedDisks folder. Ethernet 2 is to be used for the cluster HeartBeat. Both cluster VMs will be referencing the same two disks.

Once you have both machines referencing the same SharedDisks, you’ll need to do some tweaking in the VMs config file manually. Open the VM’s config file (*.vmx) in Notepad and add these two lines of code.

scsi1.sharedBus = virtual
disk.locking = "false"

Without the above lines, you will not be able to run the VMs concurrently as the SharedDisks will be locked by the first VM to run. Remember to include the two lines into both cluster VMs.

There you have it. You now have 2 VMs installed with Windows 2003 Enterprise ready to be configured for clustering. That wasn’t too hard was it? Hmmm.. Another thing I should mention here is the size of those hard disks. Well, the system disk (for OS, SQL Server binary, patches, etc) should not be less than 3GB. I believe, a 5GB system disk should do just fine. Provided that you’re not going to install too many application into the disk. Quorum disk should be relatively small in size. A 500MB disk should do the trick. Data disk size will depend on the size of your SQL Server database size. If your DB is large, then size it accordingly.

If you need more info on configuring VMs in VMWare Server, grab their User manual, or their Admin Guide for further reading.

Up next, will be how to configure Windows 2003 Enterprise for clustering – if time permits, of course.