Linux OS Service ‘scsi_reserve’

The scsi_reserve service allows you to use SCSI reservations as a fence method. An SCSI reservation restricts access to a device such that only registered nodes can access it. During system startup, the scsi_reserve script performs this registration using a unique key, based on the node’s IP address. Once the node is registered, the script will attempt to create a reservation. There will be only one reservation per SCSI device but multiple registrants can exist for an SCSI device. Each node that will perform I/O operations to the SCSI device must then register.

The reservation informs the device how the registrants are allowed to access the device. When the cluster fences a node, the node first gets unregistered. Should the node happens to be the reservation holder then the script does nothing because there may be other nodes using the device.

Service Control

The scsi_reserve service is included in the cman RPM package. To manage the scsi_reserve service for future system shutdowns and reboots, use the chkconfig tool:

# chkconfig scsi_reserve on

When enabled, the scsi_reserve script handles creation of registrations and reservations at system startup.

# scsi_reserve start

Running the scsi_reserve init script with the ‘start’ option will proceed to create registrations on all devices that were previously discovered and if necessary, it will also create the reservation.

# scsi_reserve stop

Running the scsi_reserve init script with the ‘stop’ option will attempt to remove the node’s registration key from all devices that it registered with at startup.

# scsi_reserve status

Running the scsi_reserve init script with the ‘status’ option will list the devices that the node is registered with.

Configuration

The script does source the /etc/sysconfig/scsi_reserve configuration file, should it exist, but at present its contents are not used.

Related Post