Friday, April 25, 2008

Building Windows Clusters with VMware Workstation

Most of this comes from Geert Baeke's Blog on clustering in VMware Workstation 4.5 and some other sources I can't find any more. This should work with all versions of VMware from 4.5+, and I've tested this OK on v5 and v6.

1. Base Config VMs
For a two-node cluster, create one VM with a single 4Gb disk on SCSI bus 0 and 320Mb RAM. Add Ethernet adapter 1 (Bridged) and Ethernet 2 (Host-only)

2. Heartbeat Networking
Rename Ethernet 2 (Host-only) Connection to "Heartbeat" then remove both Client for Microsoft Networks and File and Printer Sharing from the adapter config and disable NETBIOS over TCP/IP and LMHOSTS lookup

3. Create VMs - O/S
Install Windows Server Enterprise Edition and VMtools then shutdown and clone the result so you have the original plus two clones one for each node.

4. Cluster Disk Config
Fire up the first VM which will be cluster node A, add two new SCSI disks (disk1 for quorum 0.5GB, disk2 for shared data 2.0GB) on SCSI bus 1 (SCSI1:1 and SCSI1:2), make them independent, persistent, and fully allocate the drive space so that the VMs don't compete for disk file.
Close down cluster node A

5. Hacks
Edit the .vmx file (see example attached) and add the following lines if not there already, the attached version was one used in the real world whereas the following may or may not be required depending on how you have configured your disks and in what order, here goes anyway:

scsi1.sharedbus = "Virtual"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSi
ze = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0

* Add the following lines to create a second SCSI channel:

scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"

* Modify the additional hard drives to be attached to the new SCSI channel. Example:

scsi1:5.present = "TRUE"
scsi1:5.fileName = "I:\Cluster Shared\Quorum.vmdk"

scsi1:6.present = "TRUE"
scsi1:6.fileName = "I:\Cluster Shared\Data.vmdk"

* Add the following lines to disable disk locking and caching:

disk.locking = "false"
diskLib.dataCacheMaxSize = "0?

6. Add the same lines to the VMware Configuration of Cluster Node B.

7. Start VMware Workstation and start Cluster Node A. Configure the new disks as Basic disks, format them with NTFS and assign drive letters.

8. Start Cluster Node B and assign the same drive letters to the same disks.

9. Configure a new cluster with the Operating System by adding cluster services as usual with new cluster name and cluster IP.

10. You may want to allocate a cluster resource or just install SQL Server or IIS to see that it finds the cluster and operates as expected.

Let me know if there are any gotchas or stuff that needs clarification.

2 comments:

Anonymous said...

Hi,

Thank for this usefull information. I have a problem : I have done the required steps, and when I start my VMWare I have this following message :

Clustering is not supported for VMWare Workstation
This setting will be ignored

I have map the two drivers on the two server, with the same letter, when I write in the Quorum for test (Without the Cluster Service installed yet) I can't see the data on the other Server, is it normal or not ?

I'm using VMWare 6.0.3 and I would like to test the clustering with two
Windows Server 2003 ETS R2 x86 (32Bits)

Thank you

TheOtherKiwi said...

I'm guessing that by writing to the same drive at the same time without the Cluster Service will corrupt the volume or make it unreadable.

The order of events in the instructions is important for this reason. Also when editing the settings, try using Wordpad not Notepad or use a code editor that saves text files with no formatting attached.