How to use the SCSIcmd utility to perform various SCSI-2 and SCSI-3 reservation related actions.

Article: 100021389
Last Published: 2015-05-21
Ratings: 3 1
Product(s): InfoScale & Storage Foundation

Description

How to use the SCSIcmd utility to perform various SCSI-2 and SCSI-3 reservation related actions when using Veritas Infoscale.

 

Solution

The SCSIcmd utility has been enhanced to support operations on both SCSI-2 and SCSI-3 reserved disks. All the original options of SCSIcmd still exist, which can be seen by running SCSIcmd /? 

The syntax for all commands in this article is: scsicmd -d< harddisk#> -s< scsi_command>

Syntax Example: scsicmd -d14 -sscsi_reserved_status

This command will run a SCSI reservation status check on Harddisk14.

Note: In regards to this syntax, below are some further points to consider:
 
a) Make sure to include the -s before the command (i.e. -sscsi3_test) which means all commands will start with two S's. Failure to do so will result in the error below to be displayed:
 
ERROR: No such SCSI Opcode: 0xc from SCSI opcode table.
 
b) To perform an action across all disks in the system, specify ALL with the -d switch. Example: scsicmd -dALL -sscsi_reserved_status
 
c) To specify multiple disks for the command, add the harddisk number after the -d switch. For example: scsicmd -d3,4,5,7,9,11,12 -sscsi_reserved_status
 
 

I. Commands for both SCSI-2 and SCSI-3
 
scsi_reserved_status
This option provides the current SCSI reservation status (SCSI-2 or SCSI-3) of the disk(s) specified. This command can be run to determine if there is any type of reservation on the disk which might be causing access issues.
 
Syntax Example: scsicmd -d14 -sscsi_reserved_status
 
Below are some sample outputs ofor this command depending on the reservation type and status:
 
SCSI-2 Output when there is a reservation on the disk:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x2
 PathId     : 0x1
 TargetId   : 0x2
 Lun        : 0x45
 
Harddisk14 is currently SCSI-2 reserved by SCSI Address (0x2, 0x1, 0x0, 0x1) of the computer: TEST-SRV1.
 
SCSI-3 Output when there is a reservation on the disk
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x2
 PathId     : 0x1
 TargetId   : 0x2
 Lun        : 0x45
 
Harddisk 14 has SCSI-3 key(s) registered.
SCSI3 registered keys on harddisk14
Key: 7856341278563412
Key: 7856341278563412
Harddisk14 is currently under SCSI-3 reservation
SCSI3 reservation holder key on harddisk14
Key: 7856341278563412
Harddisk14 is currently being SCSI-3 reserved on the computer: TEST-SRV1.
 
SCSI2 or SCSI3 output when there is no reservation on the disk:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x2
 PathId     : 0x1
 TargetId   : 0x2
 Lun        : 0x45
 
Harddisk14 of the computer: TEST-SRV1 is not under any SCSI reservation.


II. Commands specific to SCSI-2
 
scsi2_reserve
This performs a SCSI-2 reservation. This can be run to ensure a SCSI-2 reservation can be placed on a disk. One example would be in an environment where SCSI-2 is being used, but the Clustered Disk Group fails to come online with an error : Failed to reserve a majority of the disks in the Cluster Dynamic Disk group.
 
Syntax Example: scsicmd -d12 -sscsi2_reserve
 
Example of the output of a successful reservation:
 
Harddisk12
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Successfully issued SCSI-2 reservation on harddisk12 through SCSI Address (0x3, 0x1, 0x1, 0x7) of the computer: TEST-SRV1
 
Checking the SCSI-2 reservation status on harddisk12.....
Harddisk12 is being SCSI-2 reserved.
 
scsi2_release
This option performs a SCSI-2 release reservation. This can be used in instances where there may be a stuck reservation on a disk that needs to be cleared in order for the current system to import the Disk Group.
 
Syntax Example: scsicmd -d14 -sscsi2_release
 
Example of the output of a successful reservation release on Harddisk14:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Successfully issued SCSI-2 release on harddisk14 through SCSI Address (0x3, 0x1, 0x1, 0x7) of the computer: TEST-SRV1
 
scsi2_clear
This option performs SCSI-2 bus reset/break reservation. This will not only break the reservation on the specified harddisk(s), but will also issue a SCSI BUS reset down the path(s) of the disk(s) specified. This should only be run when all disks or Disk Groups are affected on a server.
 
For example, if a server has 2 Disk Groups and only one is having an issue and the other one is imported and properly running, issuing this command could cause the cluster resource to determine that there is a reservation issue on the healthy disk and issue a resource fault. When performing a BUS reset, Infoscale will place another reservation on all imported disks, but if a cluster monitor cycle occurs prior to this, it will fault. This is more likely to occur in a Microsoft Failover cluster as it checks the reservation status every 5 seconds (whereas Veritas Cluster only checks every 60 seconds).
 
Syntax Example: scsicmd -d14 -sscsi2_clear
 
Example of a successful SCSI-2 clear command:
 
Checking for disk(s) that have the common Scsi Port number and Scsi Path Id....
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Successfully issued bus reset to ScsiPort3, PathId1.


III. Commands specific to SCSI-3
 
scsi3_reserve
This command performs a SCSI-3 reservation with a predefined SCSI-3 key (1234567812345678)
 
Syntax Example: scsicmd -d14 -sscsi3_reserve
 
Example of the output of a successful SCSI-3 reservation being placed on the disk:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Successfully performed SCSI-3 reservation on harddisk14.
 
scsi3_release
This command performs a SCSI-3 reservation release. This is only used to remove the reservation key from a specific disk down a specific path (all disks share the same key in SCSI-3). To remove a reservation completely from a disk (removing both the registrant and register key), use the scsi3_clear option instead, which is explained further below.
 
Syntax Example: scsicmd -d14 -sscsi3_release
 
Example of the output of a successful reservation:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Harddisk14 has the current SCSI-3 reservation holder:
7856341278563412
 
Successfully performed SCSI-3 release reservation on harddisk14
 
scsi3_clear
This option clears the SCSI-3 key and SCSI-3 reservation. This is the option that should be used when trying to clear a reservation on a disk that is SCSI-3 reserved. This should be used instead of the scsi3_release command as the release command does not completely clear the reservation key.
 
Syntax Example: scsicmd -d14 -sscsi3_clear
 
Example of the output of a successful clear:
 
Harddisk14
 
Scsi Address
------------------
 Length     : 0x8
 PortNumber : 0x3
 PathId     : 0x1
 TargetId   : 0x1
 Lun        : 0x7
 
Successfully performed SCSI-3 clear operation on harddisk14
 
scsi3_test
This option tests a disk to determine if it supports SCSI-3. This is a very useful command when there are plans to migrate from SCSI-2 to SCSI-3 supported storage. For example, when running Active/Active in a cluster, SCSI-3 is required and we need to confirm that the disk/array supports this.
 
Syntax Example: scsicmd -d14 -sscsi3_test
 
Example of the output of a successful SCSI-3 reservation test:
 
Test #1:  Clean up any SCSI-3 keys left on harddisk14
Test #2:  Perform SCSI-3 Register action on harddisk14 with SCSI-3 key: 7856341278563412
Test #3:  Perform SCSI-3 reservation action on harddisk14 with SCSI-3 key: 7856341278563412
Test #4:  Perform SCSI-3 release action on harddisk14 with SCSI-3 key: 7856341278563412
Test #5: Perform a part of SCSI-3 preempt action test on harddisk14.
Test #6: Perform SCSI-3 Register Ignore Existing action on harddisk14.
Test #7: Perform SCSI-3 Unregister Service Action on harddisk14.
Test #8: Perform SCSI-3 Clear Service Action on harddisk14.
SCSI-3 PERSISTENT OPERATION TESTS: All tests are PASSED on harddisk14.


   *********************************************
 
NOTE: For more details about the usage of SCSIcmd, please refer to the ReadMe.txt file from SCSIcmd.zip attached to this article.
 

 

Was this content helpful?