Question:
How to find out which HBA active path goes through on a system with HDLM?
Answer:
Solution 1:
Use lspath to show all the paths to the disk.
-
lsdev -l hdisk3
hdisk3 Available 01-09-02 Hitachi Disk Array (Fibre)
-
lspath -l hdisk3
Enabled hdisk3 fscsi0 Enabled hdisk3 fscsi1
Solution 2:
Use dlnkmgr command to figure out the HBA location code and then use lsdev to figure out the FCS number. For example:
-
dlnkmgr view -hba
HbaID Port.Bus IO-Count IO-Errors Paths OnlinePaths 00000 08.04 45031 0 4 4 00001 08.03 45999 0 4 4
-
lsdev | grep fcs
fcs0 Available 03-08 FC Adapter fcs1 Available 04-08 FC Adapter
For this example, HbaID 00000 (08.04) corresponds to fcs1 (04-08). You can then use lscfg to get the actual hardware path.
I wrote a script to find out the all the active HBA and the WWNs.
for loc in $(/usr/DynamicLinkManager/bin/dlnkmgr view -path \
|awk '/hdisk/ {print $2}'|awk -F. '{print $2"-"$1}'|sort|uniq); \
do hba=$(lsdev -Ccadapter -S A|awk '/'$loc'/ {print $1}') ; \
wwn=$(lscfg -vl $hba | awk -F. '/Network Address/ {print $NF}'); \
echo $hba $wwn ; done
fcs0 10000000C972EBAE
fcs3 10000000C972EA4B
If your system is a VIO client and does not use HDLM, then use:
for i in $(lspath|awk '/fscsi/ {print $3}'|uniq|awk -Ffscsi '{print $NF}'); \
do wwn=$(lscfg -vl fcs$i | awk -F. '/Network Address/ {print $NF}'); echo fcs$i $wwn;done
fcs0 C05076038CFC0120
fcs1 C05076038CFC0122
fcs2 C05076038CFC0124
fcs3 C05076038CFC0126
