From bfe9fa1770f245abd8fa70c56712d8da3600af93 Mon Sep 17 00:00:00 2001 From: Dan HorĂ¡k Date: Tue, 25 Aug 2020 15:08:07 +0000 Subject: zfcpconf: add support for automatic LUN scanning --- zfcpconf.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'zfcpconf.sh') 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 -- cgit