Contents
Previous Next
Enabling SCSI Reservation
SCSI reservation must be enabled in a virtual machine before you can share its disks. VMware recommends you set up any shared disks on their own SCSI bus, which is a different bus than the one the guest operating system uses. For example, if your guest operating system is on the scsi0 bus, you should set up disks to share on the next available bus, typically the scsi1 bus.
To enable SCSI reservation, make sure the virtual machine is powered off. Open the configuration file (.vmx) in a text editor and add the line:
scsi<x>.sharedBus = "virtual"
anywhere in the file, where <x> is the SCSI bus being shared.
For example, to enable SCSI reservation for devices on the scsi1 bus, add the following line to the virtual machine's configuration file:
scsi1.sharedBus = "virtual"
This allows the whole bus to be shared and is quicker than specifying each disk separately. However, if you do not want to share the whole bus, you can selectively enable SCSI reservation for a specific SCSI disk on the shared bus. For example, if you want to share a SCSI disk located at scsi1:1, add the following line to the configuration file:
scsi1:1.shared = "true"
You must specify the same SCSI target (that is, scsi<x>:1) in the configuration file for each virtual machine that is going to share the disk.
If SCSI reservation is enabled for the whole bus (that is, scsi1.sharedBus is set to "virtual"), then this setting is ignored.
In addition to enabling SCSI reservation on the bus, you need to allow virtual machines to access the shared disk concurrently. Add the following line to the virtual machine's configuration file:
disk.locking = "false"
This prevents the locking of that disk, which permits multiple virtual machines to access a disk concurrently. Be careful though: if any virtual machine not configured for SCSI reservation tries to access this disk concurrently, then the shared disk is vulnerable to corruption or data loss.
Caution: This setting applies to all disks in the virtual machine.
When SCSI reservation is enabled, the system creates a reservation lock file that contains the shared state of the reservation for the given disk. The name of this file consists of the filename of the SCSI disk appended with .RESLCK.
For example, if the disk scsi1:0.filename is defined in the configuration file as
scsi1:0.fileName = "/<path_to_config>/vmSCSI.vmdk"
then the reservation lock file for this disk has the default name
/<path_to_config>/vmSCSI.vmdk.RESLCK
You can provide your own lock filename. Add a definition for scsi1:0.reslckname to the configuration file. For example, if you add
scsi1:0.reslckname = "/tmp/scsi1-0.reslock"
to the configuration file, this name overrides the default lock filename.
Caution: Use the same lock filename (for example, "/tmp/scsi1-0.reslock") for each virtual machine in the cluster. You must also use the same SCSI target for each virtual machine when you define scsi1:0.reslckname. However, the SCSI bus (scsi1 in this case) does not need to be the same.
Once SCSI reservation is enabled for a disk that is, the scsi<x>.sharedBus = "virtual" and disk.locking = "false" settings are added to the configuration file for each virtual machine wanting to share this disk you need to point each virtual machine to this disk.