devrsrv Command
Purpose
Queries and breaks the single-path and persistent reservations on a device.
Syntax
devrsrv -c query [-e] | release | prin -s sa | (prout -s sa -r rkey -k sa_key -t prtype) -l devicename
devrsrv -d
Description
The devrsrv command queries and breaks the single-path and persistent reservations on the device. The command runs the persistent reserve in (prin) and persistent reserve out (prout) service actions.
The query subcommand queries and displays the current reservation status of the device. The release subcommand releases the reservation on the device by using the single-path reservation.
The prin subcommand displays all the registered reservation keys, reservation key holder, and capabilities information. The prout subcommand requests service action that reserves a device for the exclusive or shared use of a particular I/O path to the device. The prout subcommand supports the following service actions:
Item | Description |
---|---|
RELEASE | Releases the specified persistent reservation for the device. |
CLEAR | Clears all the reservation keys and all the persistent reservations. |
PREEMPT | Preempts the persistent reservations or removes registrations, or both. |
PREEMPT AND ABORT | Preempts persistent reservations or removes registrations, or both and stops all tasks for all preempted I/O paths to the device. |
REGISTER AND IGNORE KEY | Registers the new key value in place of the old key value. |
Flags
Item | Description |
---|---|
-c | Specifies the following subcommands:
|
-d | Lists the disk name and other identifying information for all disks that are queried or manipulated by using the devrsrv command. |
-e | Avoids opening the disk in exclusive mode, which includes both single and
diagnostic modes. This flag is applicable only for PR_exclusive and
PR_shared reservation types. If Object Data Manager (ODM) reservation policy is
single_path , this flag is ignored. Note: In some cases, if you use this flag, the
devrsrv command might not determine the reservation status of the disk or whether
the disk is already open on the local host.
|
-f | Breaks the reservation that is held by other I/O path or host. For single-path reservations, the devrsrv command issues a SC_FORCED_OPEN action to break the reservation. For persistent reservations, the devrsrv command issues a prout subcommand along with the CLEAR service action to clear the persistent reservation and the registrations. |
-k | Specifies the service action reservation key. The -k flag is required for the REGISTER, PREEMPT, and PREEMPT_ABORT service actions. |
-l | Specifies the name of the device. |
-r | Specifies the reservation key. The -r flag is required for the REGISTER, PREEMPT, PREEMPT AND ABORT, and RELEASE service actions. |
-s | Specifies the service action for persistent
reservations. The valid service actions for the prin subcommand
follow:
The valid service actions for the prout subcommand
follow:
|
-t | Specifies the persistent reservation type. The
types of persistent reservations follow:
|
Examples
The following are the examples that are related to different scenarios.
Query operation
- To query the reservation status of the
hdisk0
device when it is not reserved by any host, enter the following command:# devrsrv -c query -l hdisk0
Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : NO ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : NO RESERVE
The output shows that the device is not opened on the current host and the Object Data Manager (ODM) reservation policy is SINGLE PATH RESERVE. It indicates that the reservation policy is set in the ODM for this device. The device reservation state indicates the reservation that is present on the device. You can find the device reservation state by running a sequence of SCSI commands.
- To query the reservation status of the
hdisk1
device when it is reserved by a host, enter the following command:# devrsrv -c query -l hdisk1
The device is reserved by using the single path reservation by a host.Device Reservation State Information ================================================== Device Name : hdisk1 Device Open On Current Host? : NO ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE
- To query the reservation status of the
hdisk2
device when it is reserved on the same host, enter the following command:# devrsrv -c query -l hdisk2
Device Reservation State Information ================================================== Device Name : hdisk2 Device Open On Current Host? : YES ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE Path Id of Reserved Path : 0
- To query the reservation status of the
hdisk2
device when the ODM reservation policy is PR SHARED and the device is not reserved by any host, enter the following command:# devrsrv -c query -l hdisk0
Descriptions of several fields from the query output follow:Device Reservation State Information ================================================== Device Name : hdisk0 Device Open : NO ODM Reservation Policy : PR SHARED ODM PR Key Value : 7777 Device Reservation State : NO RESERVE Registered PR Keys : 555 777 PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C PR Capabilities Byte[3] : 0x0 PR Types Supported : NOT VALID
- Registered PR Keys:
- Displays keys that are registered by running the prout subcommand along with the REGISTER service action from all I/O paths that are sharing this device.
- PR Capabilities Bytes:
- Indicates the content of bytes 2 and 3 returned by the REPORT CAPABILITIES service action of the prin subcommand. See the SPC standard to interpret the output of the Example 4.
- PR Types Supported:
- Displays the persistent reservation types that are supported by the device that are reported by the persistent reservation type mask field in the report capabilities output.
- PR Reservation Type:
- Displays one of the values of the PR Types that are described in the Flags section.
- PR Holder key Value:
- Displays the PR key value of the current reservation holder. The persistent reservation key value is 0 if the PR Type is 5 or 6.
Persistent reserve in (prin) operation
- To read all of the registered reservation keys, enter the following
command:
# devrsrv -c prin -s 0 -l hdisk0
Registered PR Keys : 555 777
- To read the current reservation key holder and type, enter the
following command:
# devrsrv -c prin -s 1 -l hdisk0
PR Generation Value : 2 PR Type : PR_EA_RO (EXCLUSIVE ACCESS, REGISTRANTS ONLY) PR Holder Key Value : 777
- To return the PR capabilities information that is supported by
sending the report capabilities service action, enter the following
command:
# devrsrv -c prin -s 2 -l hdisk0
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C PR Capabilities Byte[3] : 0x0 PR Types Supported : NOT VALID
Persistent reserve out (prout) operation
RELEASE service action
# devrsrv -c prout -s 2 -r 1777 -t 4 -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open On Current Host? : YES
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 7777
Device Reservation State : PR SHARED
Reservation will be cleared on the device. Do you want to continue y/n:y
If
you run the query now, the result displays the Device
Reservation State as NO RESERVE. # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 7777
Device Reservation State : NO RESERVE
Registered PR Keys :
555
1777
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID
CLEAR service action
# devrsrv -c prout -s 3 -r 555 -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open On Current Host? : YES
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 5555
Device Reservation State : PR SHARED
Reservation will be cleared on the device. Do you want to continue y/n:y
If
you run the query now, the persistent reservation is released and
the registrations are removed from the device. # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 5555
Device Reservation State : NO RESERVE
Registered PR Keys : No Keys Registered
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID
PREEMPT and PREEMPT_ABORT service actions
# devrsrv -c prout -s 4 -r 777 -k 444 -t 2 -l hdisk0
# devrsrv -c prout -s 4 -r 777 -k 444 -t 2 -l
hdisk0
command, the query output is displayed as follows. # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 7777
Device Reservation State : PR EXCLUSIVE
PR Generation Value : 5
PR Type : PR_WE (WRITE EXCLUSIVE)
PR Holder Key Value : 444
Registered PR Keys :
777
444
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID
# devrsrv -c prout -s 4 -r 777 -k 444 -t 2 -l hdisk0
command,
the query output shows that the reservation is preempted by IT-nexus
with key 777 and key 444 is unregistered. # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 7777
Device Reservation State : PR EXCLUSIVE
PR Generation Value : 6
PR Type : PR_EA (EXCLUSIVE ACCESS)
PR Holder Key Value : 777
Registered PR Keys :
777
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID
RELEASE operation for SINGLE PATH RESERVE policy
hdisk0
device, enter the following commands: - Scenario 1: The current host is the owner of the reservation.
# devrsrv -c query -l hdisk0 Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : YES ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE Path Id of Reserved Path : 0
# devrsrv -c release -l hdisk0 Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : YES ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE Device is currently Open on this host by a process.Do you want to continue y/n:y Command Successful Reservation cleared on the device. Query operation may not work properly. Close the application that holds the reservation and retry.
- Scenario 2: The current host is not the owner of the reservation.
# devrsrv -c query -l hdisk0 Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : NO ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE Because the current host does not own the reservation on the device, try the force option if you want to break the reservation.
The device is already reserved by using the single-path reservation by another host.# devrsrv -f -l hdisk0
After you run the release command successfully, the query option must display NO RESERVE as the device reservation state.Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : NO ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : SINGLE PATH RESERVE Reservation will be cleared on the device. Do you want to continue y/n:y
# devrsrv -c query -l hdisk0 Device Reservation State Information ================================================== Device Name : hdisk0 Device Open On Current Host? : NO ODM Reservation Policy : SINGLE PATH RESERVE Device Reservation State : NO RESERVE
Forced mode
hdisk0
device
is reserved with key 777 from another I/O path. To release this reservation
from the other client, enter the following command: # devrsrv -f -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk16
Device Open On Current Host? : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 5555
Device Reservation State : PR SHARED
Reservation will be cleared on the device. Do you want to continue y/n:y
Command Successful
Before you run the # devrsrv
-f -l hdisk0
command, the query displays the following output: # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 5555
Device Reservation State : PR EXCLUSIVE
PR Generation Value : 1
PR Type : PR_WE (WRITE EXCLUSIVE)
PR Holder Key Value : 777
Registered PR Keys :
777
PR Capabilities Byte[2] : 0xd SIP_C ATP_C PTPL_C
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID
After you execute
the # devrsrv -f -l hdisk0
command, the output indicates
that the device is not reserved. # devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk16
Device Open On Current Host? : NO
ODM Reservation Policy : PR SHARED
ODM PR Key Value : 5555
Device Reservation State : NO RESERVE
Registered PR Keys : No Keys Registered
PR Capabilities Byte[2] : 0x0
PR Capabilities Byte[3] : 0x0
PR Types Supported : NOT VALID