From 2951e5a3069f4ff6f53afc817bf6c8b169037288 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 2 Jun 2011 13:27:10 +0000 Subject: [PATCH] scst: Update ALUA documentation git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3513 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scst/README b/scst/README index 9822d9f83..65735fdfb 100644 --- a/scst/README +++ b/scst/README @@ -1335,6 +1335,20 @@ of the device mapper. You will have to modify at least the following in /etc/multipath.conf: * path_checker scsi_dh_alua * prio_callout "/sbin/mpath_prio_alua /dev/%n" + +If your distribution does not provide a /sbin/mpath_prio_alua script, you can +use the following implementation: +$ cat /sbin/mpath_prio_alua +#!/bin/bash +# Given a SCSI device node, query the target port group asymmetric access +# state and report it in numeric form. +tpg_id="$(sg_vpd --page=di "$1" | sed -n 's/.*Target port group: //p')" +aas="$(sg_rtpg "$1" \ +| grep -A1 "target port group id : $tpg_id" \ +| tail -n 1 \ +| sed 's/.*target port group asymmetric access state : //')" +echo $((aas)) + More information about how to configure the device mapper and the scsi_dh_alua driver can be found in the manual of your Linux distribution.