Enabling SCSI-3 SCSI Persistent Reservation to IBM GPFS

Just bought a QNAP device for tests, configured ISCSI which supports various PR modes of ISCSI, but IBM GPFS 5 on RHEL 7 keeps saying that disk does not support Persistent Reservation mode. However this is due to fact, that IBM limits list of devices which they support for PR on GPFS (probably for commercial reasons). However practically the range supported of devices is wider.

So my ISCSI device did support the mode:

# sg_persist -d /dev/sdb -c
  QNAP      iSCSI Storage     4.0
  Peripheral device type: disk
Report capabilities response:
  Compatible Reservation Handling(CRH): 1
  Specify Initiator Ports Capable(SIP_C): 1
  All Target Ports Capable(ATP_C): 1
  Persist Through Power Loss Capable(PTPL_C): 1
  Type Mask Valid(TMV): 1
  Allow Commands: 1
  Persist Through Power Loss Active(PTPL_A): 1
    Support indicated in Type mask:
      Write Exclusive, all registrants: 1
      Exclusive Access, registrants only: 1
      Write Exclusive, registrants only: 1
      Exclusive Access: 1
      Write Exclusive: 1
      Exclusive Access, all registrants: 1

However when I tried to enable the persistent reservation, I got following output:

# mmchconfig usePersistentReserve=yes

Verifying GPFS is stopped on all nodes ...
mmchconfig: Processing disk nsd1
mmchconfig: Device sdb does not support PR_shared reserve policy.
mmchconfig: Unable to set reserve policy PR_shared on disk nsd1 on node xserver1.

However, after digging a little bit into mmchconfig, seems like it is script, and it calls some support libraries to detect, what is supported and what not. Thus by after 30 min of analysis, I did found out that there is list of supported devices into one of the GPFS scripts. Thus lets enable support for our QNAP NAS (note that match in the script is done against first line returned by sg_persist, in our case QNAP* would be fine):

Edit /usr/lpp/mmfs/bin/mmfsfuncs.Linux with following updated (right before HITACHI):

diff mmfsfuncs.Linux.backup mmfsfuncs.Linux

+  # QNAP OK
+  if [[ $searchString = "QNAP"* ]]; then
+      return 0
+  fi
+
 

Now trying out:

# mmchconfig usePersistentReserve=yes

Succeeds!!!! And if checking the drive statuses, my drive happily shows that PR is enabled:

# mmlsnsd -X

 Disk name       NSD volume ID      Device          Devtype  Node name or Class       Remarks
-------------------------------------------------------------------------------------------------------
 nsd1            XXXXXXXXFFFFFFFF   /dev/sdb        generic  xserver1                  server node,pr=yes
 nsd1            XXXXXXXXFFFFFFFF   /dev/sdb        generic  xserver1                  server node,pr=yes
 nsd1            XXXXXXXXFFFFFFFF   /dev/sdb        generic  xserver1                  server node,pr=yes

And the reservation keys are assigned too:

]# /usr/lpp/mmfs/bin/tsprreadkeys sdb
Registration keys for sdb
1. 00006d0000000001
2. 00006d0000000003
3. 00006d0000000002

Thus for sort of development testing, this shall be fine. However, I strongly recommend DO NOT DO THIS for production! Just get some official advice for IBM, on which disk arrays PR mode is supported or ask IBM permission to enable new device.