How to check dual path in AIX

How to check dual path in AIX

 
How to verify if there is dual paths to SAN disks in AIX Operating System

In this context we are using two important command which is lspath and dlmkmgr.
lspath is the native AIX command which is included in the OS.
dlnkmgr comes from Hitachi software and you need to install it before you can use it on AIX.

To list hard disks connected to the server, its status and path.
=====================================================
[root@myserver]# /usr/sbin/lspath
Enabled hdisk0  vscsi0
Enabled hdisk0  vscsi1
Enabled hdisk1  fscsi0
Enabled hdisk2  fscsi0
Enabled hdisk3  fscsi0
Enabled hdisk4  fscsi0
Enabled hdisk1  fscsi1
Enabled hdisk2  fscsi1
Enabled hdisk3  fscsi1
Failed     hdisk4  fscsi1
=====================================================
Explanation:
If you noticed the output, it contains list of hard disks (hdisk), status and which scsi it is connected to. "vscsi" is referring to virtual scsi and "fscsi" is referring to fiber channel scsi. "Enable" means the disk is enabled. There are two scsi listed for each hard disk and this means each hard disk is connected with dual path. Noticed one of the path for hdisk 4 failed.


To do a quick check on the number of path present (does not mean all are Enabled] using for loop.
=====================================================
[root@myserver]# for i in `/usr/sbin/lspath|grep scsi|awk '{print $2}'|sort|uniq`; do echo "$i `/usr/sbin/lspath |awk '/'$i' /' |uniq|awk '/Enabled/'|wc -l`";done
[root@myserver]# for i in `/usr/sbin/lspath|grep scsi|awk '{print $2}'|sort|uniq`; do echo "$i `/usr/sbin/lspath |awk '/'$i' / {print $2}'|wc -l`";done
hdisk0        2
hdisk1        2
hdisk2        2
hdisk3        2
hdisk4        2
=====================================================


To determine if all the paths are working using DynamicLinkManager.
=====================================================
[root@myserver]# /usr/DynamicLinkManager/bin/dlnkmgr view -lu -c -item
Product S/N     LUs iLU  SLPR HDevName VG         Paths  OnlinePaths
USP     0060121  89 0230    0 hdisk1  vg01      2           2
                              040A    0 hdisk2  vg02      2           2
                              040B    0 hdisk3  vg03      2           2
                              0411    0 hdisk4  vg04      2           1
=====================================================
Noticed that the "OnlinePaths" for hdisk4 is 1. This means one of the path might be having some problem.
Note: The dlnkmgr commands used in this article can only detect disk devices connected through fscsi. To detect those using vscsi please use lspath.

To determine if all the paths are working using lspath.
=====================================================
[root@myserver]# lspath -H -F "name parent path_id connection status"
name   parent path_id connection         status

hdisk0 vscsi1 0       810000000000       Enabled
hdisk1 vscsi1 0       820000000000       Enabled
hdisk3 vscsi1 1       840000000000       Enabled
hdisk2 vscsi1 1       830000000000       Enabled
hdisk4 fscsi0 0       50060e8004eae731,0 Enabled
===================================================== 


To list more details on all disk devices status except for the ones connected via vscsi.
=====================================================
[root@myserver]# /usr/DynamicLinkManager/bin/dlnkmgr view -lu -item
Product       : USP
SerialNumber  : 0012345
LUs           : 89
iLU  SLPR HDevName VG         OSPathID PathID PathName                        ChaPort CLPR Status     Type IO-Count   IO-Errors  DNum IEP
0230    0 hdisk1  vg01        00000    000068 08.08.0000000000012400.0026     1M         0 Online     Own    71822950          0    0 -
                              00001    000069 08.06.000000000002AC80.0026     2M         0 Online     Own    71822507          0    0 -
040A    0 hdisk2  vg02        00000    000078 08.06.000000000002AC80.001F     2M         0 Online     Own      388064          0    0 -
                              00001    000079 08.08.0000000000012400.001F     1M         0 Online     Own      388537          0    0 -
040B    0 hdisk3  vg03        00000    000074 08.06.000000000002AC80.0027     2M         0 Online     Own    14968067          0    0 -
                              00001    000075 08.08.0000000000012400.0027     1M         0 Online     Own    14969600          0    0 -
0411    0 hdisk4  vg04        00000    000102 08.06.000000000002AC80.0037     2M         0 Online     Own    12887367          0    0 -
                              00001    000103 08.08.0000000000012400.0037     1M         0 Offline     Own    12887438          0    0 -
=====================================================
Noticed that the "Status" for PathID "000103" used by hdisk4 is "Offline". This means it might be having some problem.

Next try to enable the failed path for hdisk4 to see if it worked.

To enable the failed path for hdisk4 and see if it worked
=====================================================
root@myserver# chpath -l hdisk4 -p fscsi1 -s enable
paths Changed

[root@myserver]# /usr/sbin/lspath |grep hdisk4
Enabled hdisk4  fscsi0
Enabled     hdisk4  fscsi1
=====================================================

The below command will use lspath to identify number of path configured and number of those path which are online
=====================================================
root@myserver# echo "Dev         NoPath    Online     ThroughNoOfInterface";for i in `lspath -H -F 'name parent path_id connection status'|awk '!/name / {print $1}'|sort|uniq`;do echo "$i; `lspath -H -F 'name parent path_id connection status'|awk '/'$i' /{print $4}'|uniq|wc -l`; `lspath -H -F 'name parent path_id connection status'|awk '/'$i' / && /Enabled/ {print $4}'|uniq|wc -l`;        `lspath -H -F 'name parent path_id connection status'|awk '/'$i' / {print $2}'|uniq|wc -l`" ;done
Dev         NoPath    Online     ThroughNoOfInterface
hdisk0;        1;        1         1
hdisk1;        1;        1         1
hdisk2;        3;        1         1
hdisk3;        3;        1         1
hdisk4;        3;        1         1
=====================================================

To get WWN
=====================================================
root@myserver# lscfg -vl fcs0|grep Network
        Network Address.............10000000C93CD567
root@myserver# fcstat fcs0 |grep "World Wide Port"
World Wide Port Name: 0x10000000C93CD567
=====================================================

To get MAC address of fcs
=====================================================
root@myserver# lsconf |grep fcs
+ fcs0             U7311.D20.657CEDA-P1-C02-T1                                  FC Adapter
+ fcs1             U7879.001.DQD0HWE-P1-C1-T1                                   FC Adapter
=====================================================

To check which fscsi is related to fcs
=====================================================
root@myserver# lsdev -C |grep fscsi
fscsi0         Available 07-08-02      FC SCSI I/O Controller Protocol Device
fscsi1         Available 06-08-02      FC SCSI I/O Controller Protocol Device
root@myserver# lsdev -C |grep fcs
fcs0           Available 07-08         FC Adapter
fcs1           Available 06-08         FC Adapter
=====================================================
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
AIX, Security, System Admin↑ Generating random passwords
Viewed 2803 times since Fri, Apr 19, 2019
Recovery AIX system when hang on boot (554 code error).
Viewed 15410 times since Thu, Feb 21, 2019
AIX QHA
Viewed 10855 times since Mon, Jun 3, 2019
How to clear/clean/erase/delete/reset network adapter configuration on AIX?
Viewed 12187 times since Thu, Nov 29, 2018
AIX: How to identify the program listening in the given port
Viewed 2249 times since Mon, Jun 11, 2018
Getting bosboot errors, don’t reboot just yet
Viewed 2709 times since Tue, Apr 16, 2019
Many Choices for AIX File Integrity
Viewed 2516 times since Wed, May 30, 2018
Find out which port the daemon is using on AIX OS. (similar like command netstat -anp for Linux)
Viewed 11038 times since Thu, Feb 21, 2019
Topics: AIX, Networking, System Admin
Viewed 11319 times since Fri, Apr 19, 2019
Aix: How to assign a specific PVID
Viewed 6825 times since Fri, Feb 1, 2019