Get controller or LUN WWN / WWID under HP-UX

Reading the World Wide Name (WWN) / World Wide Identifier (WWID) of a controller or a LUN is not always easy unter HP-UX - depending on the release. Especially under the older releases 11.11 and 11.23 additional tools are required to get the requested information - this is much easier under 11.31.

Controller information

Using ioscan a overview about mounted Fibre-channel cards:

1# ioscan -fnkCfc
2Class     I  H/W Path     Driver   S/W State   H/W Type     Description
3========================================================================
4fc        0  0/3/0/0/0/0  fcd      CLAIMED     INTERFACE    HP AD300A 4Gb Dual Port PCIe Fibre Channel Adapter (FC Port 1)
5                         /dev/fcd0
6fc        1  0/3/0/0/0/1  fcd      CLAIMED     INTERFACE    HP AD300A 4Gb Dual Port PCIe Fibre Channel Adapter (FC Port 2)
7                         /dev/fcd1

Depending on the controller type (td/fcd driver) one of the following tools are executed and combined with grep to get the Port WWN/WWID:

1# fcmsutil /dev/fcd0|grep "N_Port Port World Wide Name"
2            N_Port Port World Wide Name = 0x500...
3
4# tdutil /dev/td0|grep "N_Port Port World Wide Name"
5            N_Port Port World Wide Name = 0x500...

Alternatively you can use the fcmsutil utility - this tool automatically chooses the required "sub tool":

1# fcmsutil /dev/fcd0|grep "N_Port Port World Wide Name"
2            N_Port Port World Wide Name = 0x500

LUN information

Under HP-UX 11.31 ioscan has been updated and so it's able to get the WWID of a LUN - e.g. for hard drives:

1# ioscan -kCdisk -P wwid
2Class     I  H/W Path  wwid
3===============================
4disk      2  64000/0xfa00/0x1   0x500...
5disk      3  64000/0xfa00/0x3   0x500...
6...

This feature doesn't exist under HP-UX 11.11 and 11.23 - using this releases you'll have to use the above-mentioned tool:

1# fcmsutil /dev/fcd0 get remote all
2
3                    Target N_Port_id is = 0x0b1b00
4                           Target state = DSM_UNOPENED
5                          Symbolic Name =
6                              Port Type = UNKNOWN
7                          FCP-2 Support = NO
8            Target Port World Wide Name = 0x500...
9            Target Node World Wide Name = 0x500...

Unfortunately, the assigment between hard drive and WWID isn't clearly obvious. Using lssf you can determine the associated controller and list all connected devices using fcmsutil. If the list of connected devices isn't too long, you can find the correct device with some luck:

 1# lssf /dev/dsk/c57t0d3
 2sdisk card instance 57 SCSI target 0 SCSI LUN 3 section 0 at address 0/7/0/0/0/0.50.12.0.1.0.3 /dev/dsk/c57t0d3
 3
 4# ioscan -H 0/7/0/0/0/0 -fnC fc
 5Class     I  H/W Path     Driver   S/W State   H/W Type     Description
 6========================================================================
 7fc        2  0/7/0/0/0/0  fcd      CLAIMED     INTERFACE    HP AD300A 4Gb Dual Port PCIe Fibre Channel Adapter (FC Port 1)
 8                         /dev/fcd2
 9
10# fcmsutil /dev/fcd2 get remote all
11...
12Target N_Port_id is = 0x996900
13Target state = DSM_READY
14Symbolic Name = IBM 2145 0000
15Port Type = N_PORT
16FCP-2 Support = NO
17Target Port World Wide Name = 0x500...
18Target Node World Wide Name = 0x500...

Unfortunately this approach is not really time-saving.

Translations: