Building clusters with shared disk using VMWare server 2.0

I have a couple of lab machines that are running VMWare server 2.X under 64-bit CentOS 5.2. VMWare server has a cool feature where you can create “clusters in a box.” The cluster in a box feature allows you to share a virtual disk between more than one virtual machine, and since it support SCSI persistent reservations, you can truly simulate a real cluster. I have used this to deploy Oracle RAC, Solaris Cluster and Redhat Cluster server in my lab environment.

Based on the cluster in a box documentation on the VMWare website, sharing a disk between multiple nodes can be achieved by creating a virtual disk, and then importing that disk into each virtual machine. Once the disk is imported, you can add (or modify if they exist) the “scsiX.sharedBus = virtual” (X should match the controller that is used to host the shared disk) and “disk.locking = false” directives to the shared disk stanzas in each virtual machines vmx file. Here is a sample from a node I set up this weekend:

scsi1.present = “TRUE”
scsi1.sharedBus = “virtual”
scsi1.virtualDev = “lsilogic”
scsi1:0.present = “TRUE”
scsi1:0.fileName = “/data/vmware/shared/solariscluster/Disk1.vmdk”
disk.locking = “false”

This has served me well in my lab environment for quite some time, though I provide ZERO guarantees that it will work in yours (and there is always the possibility that sharing disk between multiple nodes will corrupt data). I am documenting this here as a reference for myself, though feel free to use this information at your own risk.

3 Comments

Peter  on March 23rd, 2009

As Sun Cluster since last update allows software-based reservations I’m going to try building cluster in VirtualBox with iSCSI shared storage. This way you should be free from dependency on virtualization software functionality.

Jeff  on March 24th, 2009

Interesting post. Any idea if the cluster in a box config will work in an ESXi environment? I’m going to look into this for myself but wanted to post the question here for discussion.

gp  on June 11th, 2009

Thanks dude! this works like a charm to me (Sun Cluster 3.2u2 + Solaris 10u7 guest on a VMware server 2.0.1 host)

Leave a Comment