/
7.9 SCSI Lock

7.9 SCSI Lock

SCSI reservation agent can manage and protect the shared disks from the H/W perspectives.
If you use a SCSI reservation agent, you can safely protect the data disk against the split brain situations caused by external elements such as OS hanging.
If the shared storage supports SCSI3-PR (Persistent Reservation), you can use it together with SCSI reservation agent to improve the level of security for the shared data.
If you want to access the storage from systems (many or one) through SCSI3-PR, the system must have a storage reserved key. If not, storage access will not be granted.

* Note - If the storage does not support SCSI3-PR (Persistent Reservation), it cannot use a SCSI-reservation agent.

Table of Contents

How to work

The resource created by a SCSI reservation agent will have a registered key for each node. You can check it in the attributes.
For an online node, set its own registration key as the reservation key.
SCSI reservation agent uses the reservation keys to differentiate nodes that can be accessed and determine whether disk access should be granted.
To be able to safely protect the systems shared data against the Split-Brain situations, you should define the dependency between the SCSI reservation resource and the shared disk resource.


 

Requirement

External storage must support SCSI-3 PR.
Volume should be configured by LUN(Logical Unit Number) unit. Partitioned volume in a LUN is not supported.

 

 

Types of Shared disk resource

To configure HA with shared storage environment, MCCS provides shared disk agent and SCSI Lock agent.
You can use only shared disk resource, or use with SCSI Lock resource. Shared disk resource depends on SCSI Lock resource and multiple shared disk resource can depends on a SCSI Lock resource.

An environment where only shared disk agent is used

  • The disk volume is partitioned in a LUN.
  • External storage does not support SCSI-3 PR.


Difference between shared disk agent and SCSI Lock agent
1. Shared disk agent manage disk access in local node, but SCSI Lock agent manage node access in storage.

Disk management function in software perspective (shared disk agent)

  • Shared disk agent manage access control of shared disk through Mantech Volume Lock (MVL) kernel driver. 
  • Data will be corrupted if writing access is done from multiple nodes in shared disk. MVL locks access to the shared disk resource. You cannot access the volume of shared disk before it unlocks access. Only a node allow to access to the shared disk resource by this.
  • MVL can be managed both in LUN unit and partition unit.

Disk management function in hardware perspective (SCSI Lock agent)

  • SCSI Lock agent manage Write control and access control of LUN by using SAN protocol.
  • Only the node that has imported the disk with this key can access to the disk.



2. Both the shared disk agent and the SCSI reservation agent can read and write data.
However, a SCSI reservation agent intends to protect the shared storage resource, so you are not recommended to use it alone to read and write data. 

Configuration

 

There are two different ways to configure the SCSI reservation agent resource and the shared disk agents resource. It depends on the attribute of the SCSI reservation agent resource.


1. When shared disk and SCSI Lock resource is configured with the same LUN

A shared disk agent uses the MVL driver to manage DATA-DISK and a SCSI reservation agent uses the SCSI3-PR function to manage LOCK-DISK.
By setting the dependency between the SCSI reservation resource and the shared disk resource, you can prevent damages to DATA-DISK caused by Split-Brains and so on.

 

[Figure] Shared disk and SCSI Lock resource configured in same LUN 


 

Meaning of DATA-DISK

  • It is a disk created by using a shared disk agent. It represents a disk where the actual user data is used.  

Meaning of LOCK-DISK

  • It is a disk created by using a SCSI reservation agent.
    This is the disk that depends on DATA_DISK used in the shared disk when linking a shared disk agent.

 

 

Configuration Sample

1. Shared disk and SCSI Lock resource is configured in same LUN.

[Figure] Shared disk and SCSI Lock resource configured in same LUN

 

First, register shared disk agent according to the procedure and after check if it works normally, check disk of SCSI Lock agent. 

Registration Procedures

  1. Install MCCS on both nodes
  2. Set group
  3. Add shared disk resource
  4. Enable shared disk resource and check offline on both nodes
  5. Add SCSI Lock resource (Select drive letter that created shared disk resource)
  6. Enable SCSI Lock resource and check key in resource attribute of MCCS console.
  7. Configure dependency of resources (SCSI Lock resource must go online first)
  8. Test failover from node 2 to 1 
  9. Test failover from node 1 to 2
  10. Set application that customer uses



Adding

Add the SCSI reservation application resource to a group.
Before configuring the SCSI reservation resource, you must configure the volume in advance by using the SCSI3 supporting storage. 

  1. Select a group → right click → 'Add Resource'. 

  2. Select 'SCSILock' from Resource Type lists and click 'Next' button. 

  3. Enter resource name. If you skip enter resource name, this will be given 'SLock_value' which value is selected driver letter.

    [Figure] SCSI Reservation Resource Added


  4. Click the 'Finish' button to add the SCSI reservation resource. 
    You can immediately check the result in the management web console.

Deleting

Select resource type → right click → delete resource.
The deleted resource will immediately disappear from the management web console.

Status

The following table explains the status switching of the MCCS resource caused by a user's command and the status.
The command assumes that it is generated by a user.

SCSI reservation agent: Manages the SCSI reservation disk.  

StatusAgent commandDescriptionNote

Online

Disk key is exclusively reserved at an online node.
You cannot register a key at another node. 

Offline

It switches to offline while maintaining the reservation.

 
Monitoring

Check if there is a reservation made on the disk.

 

Offline

1. Disk is reserved but the resource is still offline.
2. The actual offline state where the other node acquired a reservation. 

OnlineRegister a key for a disk reservation and wait for a response from the other node.  
Monitoring

Check if there is a reservation made on the disk.

 

Trouble

It occurs when a reservation is stolen while going online.

OnlineRegister a key for a disk reservation and wait for a response from the other node.  
OfflineIt switches to offline while maintaining the reservation. 

 

 

Attribute

Display the unique attribute of SCSI reservation resource.

Attribute

Description

Type

DefaultEditNote
DiskDUID

DUID(Device Unique ID, 16 byte as Hex value) of disk is used as identifier. Specify DUID of reserve disk.
This value is secure when DriveLetter atribute us specified. Try not to insert this value yourself.
DUID information can be checked through scsicmd.cmd command and both nodes need to have the same value.

STRING X 
DriveLetter

Disk to be used for reservation is specified by drive letter.
When register drive letter, DUID of connected disk will automatically obtain in drive letter.

STRING X 
KeyMAC address is used as Reserved-Key. This key is automatically set by agent.STRING   
PreemptWaitCount

Time waiting for permission of other node before reservation
Waiting time is (PreemptWaitCount * MonitorInterval) seconds.

INTEGER2 timesO 
PrType

This attribute decides on how to give the permission of reserve disk access as Persist Type specified in SCSI3-PR spec.
There are 6 types bur MCCS uses 5 (Write Exclusive Registor Only) .

INTEGER

Prtype=5O 

 

 

scsicmd.cmd Command

Syntax

 scsicmd [option] [diskID]

Option

This is the utility to use SCSI 3 PR command more easily. Following is the provided options

Option

Description

-c diskId

It deletes Reserved-Key and Registered-Key of local node of disk.

-cf diskId

It forcely deletes Reserved-Key and Registered-Key of local node of disk.
This is mostly used when access to disk is inavailable.

-r diskIdRegisters diskld-specified disk.

-l diskId

If node is yet to reserve, close the specified disk and reserve.   

-lf diskId

It forcelu closes specified disk and reserve, even node has been reserved.
Meaning, it takes over other reservation.

-hIt shows help of scsicmd.

no option

It shows the state information regarding disk reservation when there is no other option.

Print Sample

The output of 'scsicmd' command from source node (C29043F13 is MAC Address of NIC from source node.)

Disk DUID(DeviceUniqueID)LetterPRReserved-KeyRegistered-Keys
0 CNononenone
1 DNononenone
200c0ffd796550000f38be34f01000000EYesnonenone
300c0ffd796550000138ce34f01000000FYesC29043F13*C29043F13*
400c0ffd7965500002e8ce34f01000000GYesnonenone

 

The output of 'scsicmd' command from target node (C29043F13 is MAC Address of NIC from source node.)

Disk DUID(DeviceUniqueID)LetterPRReserved-KeyRegistered-Keys
0 CNononenone
1 DNononenone
200c0ffd796550000f38be34f01000000EYesnonenone
300c0ffd796550000138ce34f01000000FYesC29043F13C29043F13
400c0ffd7965500002e8ce34f01000000GYesnonenone

Disk 0 (C:)'s PR is set to "No". So, you can see that the disk does not support SCSI3-PR.  (In general, the "C" drive is the system booting disk and it does not support SCSI.)
Besides, Disk 1 (D:)'s PR is set to "No". You can see that the disk does not support SCSI3-PR.(Internal Disk does not support SCSI3-PR.)
Disk 2 (E:) and Disk 4 (G:)'s SCSI3-PR is set to "Yes". So, it means that the storage used supports SCSI3- PR. Their Reserved-Key and Registered-Keys are set to "none". It means that they are not yet to be registered.
Disk 3 (F:)'s Reserved-Key and Registered-Keys at the source node are set to C29043F13* and C29043F13* and at the target node to C29043F13 and C29043F13. This means that a SCSI reservation agent was used to create the resource.
The (*) marked node with the Reserved-Key and Registered-Keys indicates that a disk is reserved. In addition, only the * marked node with the Reserved-Key value (ex: C29043F13*) can access the disk.

 

 

Related content