Clustering in VMware

By Thomas Vachon

Ever wonder if you could try playing with clustering, but without all the expense? Well you are in luck. It is pretty simple to do.

This guide is for Windows Server 2003 or earlier, it will NOT work in Server 2008. The reason this won't work in Server 2008 is that Microsoft has removed the ability for Microsoft Clustering Service (MSCS) to use shared storage. This will work in all other versions of Windows Server that have MSCS.

Why use MSCS? Well that is an important question, MSCS is the primary clustering technology for all Windows applications, except Web technologies. This means Exchange, SQL Server, etc. While you can use IIS on <=2k3, with the provided vbs scripts in the inetsrv folder in system32, it is not recommended due to the nature of web tech. MSCS is usually configured in a Active/Passive cluster for High Availability.

First of all, install both your operating systems. For MSCS, the operating systems must be Enterprise or Datacenter level installs, MSCS is not enabled in Standard or Web Editions. At this time do NOT install your intended cluster application, you must have MSCS running before that. Shut down both of your virtual machines. Then add a SCSI drive, with independent persistent mode. Then go into advanced drive configuration and change it to an unused SCSI bus. I generally use SCSI1:x. Then edit the .vmx file for the vmware machine with Notepad or something similar. Add these lines, change the X and Y to match your scsi bus and drive number.

SCSIx:y.shared = "TRUE"
SCSIx:y.redo = ""
disk.locking = "FALSE"

Then boot up that virtual machine and initialize and format the drive. Now edit the second .vmx file and add all the files relating to the SCSIx:y drive plus the ones above. Then close the vm, if you have its view open. Double click the VM and it will re-parse the VMX, the second hard drive should show up now.

Now start the MSCS wizard and run through it on the first computer. After that is done, add the second computer to the cluster via the Add a Node wizard. Once you have the basic cluster running, do some testing. Do a move group, bring a computer down, make sure things are working as they should.

Finally, you can install your application. In my case, it is generally SQL Server 2005. You will be able to check the "Create a Failover Cluster" checkbox once MSCS is working. One interesting thing, with SQL Server 05 (not sure about earlier versions), you put the CD in only 1 of the servers in the cluster, select the member servers, and it will install on all of them automatically. Now you have a cluster working on VMWare at a fraction of the cost of doing this on physical boxes.