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.

This article was posted by Matty on 2009-03-22 23:39:00 -0400 -0400