summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2020-08-25 15:08:07 +0000
committerDan Horák <dan@danny.cz>2020-08-25 15:08:07 +0000
commitbfe9fa1770f245abd8fa70c56712d8da3600af93 (patch)
treed37896da8896309a15c1ce0d0ed1b8a6816fd568
parent021e1c91bc41d46fa2b5b33e52f9c4731e013780 (diff)
downloadutils-bfe9fa1770f245abd8fa70c56712d8da3600af93.tar.gz
utils-bfe9fa1770f245abd8fa70c56712d8da3600af93.tar.xz
utils-bfe9fa1770f245abd8fa70c56712d8da3600af93.zip
zfcpconf: add support for automatic LUN scanning
-rw-r--r--zfcpconf.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/zfcpconf.sh b/zfcpconf.sh
index dca117e..8dc05ad 100644
--- a/zfcpconf.sh
+++ b/zfcpconf.sh
@@ -2,10 +2,12 @@
# config file syntax:
# deviceno WWPN FCPLUN
+# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
#
# Example:
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
+# 0.0.5000
#
#
# manual setup:
@@ -42,6 +44,17 @@ if [ -f "$CONFIG" ]; then
*)
[ -z "$line" ] && continue
set $line
+ if [ $# -eq 1 ]; then
+ DEVICE=${1##*0x}
+ if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
+ set_online ${DEVICE}
+ grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
+ echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
+ else
+ echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
+ fi
+ continue
+ fi
if [ $# -eq 5 ]; then
DEVICE=$1
SCSIID=$2