How to check HBA host and its corresponding WWPN on RHEL?

Solution Unverified - Updated

Environment

  • Red Hat Enterprise Linux 5, 6, 7, 8, and 9
  • FC/FCoE Host Bus Adapter (QLogic, Emulex, Brocade, Cisco, etc.)

Issue

  • How to check HBA host and its corresponding WWPN?
  • How do I lookup WWN of installed HBAs?
  • How do I locate the world wide number of an hba WWPN (world wide port name)?
  • How do I locate the world wide name of an hba?
  • How to find out which Port Name is being used by an HBA Fibre Channel port?
  • I need to associated my HBA ports WWPN within the Fibre Channel switch. How can I found out the correct name?

Resolution

$ find /sys/class/fc_host/*/ -name 'port_name'             << retrieve path to wwpn entry
$ find /sys/class/fc_host/*/ -name 'node_name'             << retrieve path to wwnn entry

$ grep -v "zZzZ" -H /sys/class/fc_host/host*/*_name /sys/class/fc_host/host6/fabric_name:0x100000051e900105 << switch port name, wwpn /sys/class/fc_host/host6/node_name:0x200000e08b87de9a << HBA node name, wwnn /sys/class/fc_host/host6/port_name:0x210000e08b87de9a << HBA port name, wwpn /sys/class/fc_host/host6/symbolic_name:QLE2462 FW:v7.03.00 DVR:v8.07.00.18.07.2-k
:
.

In the case where it is insufficient to know just the WWNN/WWPN that exists for a scsi host and it is desired
to know the actual pci address assigned to a particular scsi host -- then the following can be used:
</font color="grey">
$ find ./sys/devices -type d -name 'host*' | egrep -v "host_busy|fc_host|scsi_host" | sort ./sys/devices/pci0000:00/0000:00:01.0/0000:04:00.0/host4
./sys/devices/pci0000:00/0000:00:04.0/0000:08:00.0/host10
./sys/devices/pci0000:00/0000:00:05.0/0000:0b:00.0/host5
./sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host8
./sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.1/host9
./sys/devices/pci0000:00/0000:00:0a.0/0000:14:00.0/host6 << card pci address for host6/scsi6 ./sys/devices/pci0000:00/0000:00:0a.0/0000:14:00.1/host7
:
.

$ systool -c fc_host -v Class = "fc_host"

Class Device = "host6"
Class Device path = "/sys/devices/pci0000:00/0000:00:0a.0/0000:14:00.0/host6/fc_host/host6"
dev_loss_tmo = "45"
fabric_name = "0x100000051e900105" << switch port name, wwpn issue_lip = max_npiv_vports = "127"
node_name = "0x200000e08b87de9a" << HBA node name, wwnn npiv_vports_inuse = "0"
port_id = "0x010300"
port_name = "0x210000e08b87de9a" << HBA port name, wwpn port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "4 Gbit"
supported_classes = "Class 3"
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit"
symbolic_name = "QLE2462 FW:v7.03.00 DVR:v8.07.00.18.07.2-k"
system_hostname = ""
tgtid_bind_type = "wwpn (World Wide Port Name)"
uevent =
:
.

  • Additional information is available within "How do I find the FC ID (WWN) of a disk/LUN", which discusses end-to-end transport identification (disk, scsi address, host [hba/pci address], switch port, storage port, lun). This references an unsupported/as-is utility called mapdevs that can be run on RHEL to display, among other things, an hba-to-storage wwn map.
# ./mapdevs -Hp
#scsi_addr   name                   version                f/w                       device
#----------- ---------------------- ---------------------- ------------------------- ----------------------------------------------
:
 6:*:*:*     qla2xxx                8.07.00.38.07.4-k1     8.06.00 (9496)            /sys/devices/pci0000:00/0000:00:0a.0/0000:14:00.0/host6
 7:*:*:*     qla2xxx                8.07.00.38.07.4-k1     8.06.00 (9496)            /sys/devices/pci0000:00/0000:00:0a.0/0000:14:00.1/host7

--------- PCI -------------

subsystem model model

scsi_addr vendor device vendor device name description


----------- ------ ------ ------ ------ ------------ --------------------------------------------------


:
6:*:*:* 0x1077 0x2432 0x1077 0x0138 QLE2462 PCI-Express Dual Channel 4Gb Fibre Channel HBA 7:*:*:* 0x1077 0x2432 0x1077 0x0138 QLE2462 PCI-Express Dual Channel 4Gb Fibre Channel HBA

scsi_addr name speed state symbolic_name port_type


----------- ------------------ -------- -------- ---------------------------------------------- -----------------------------------------------


:
6:*:*:* qla2xxx 4 Gbit Online QLE2462 FW:v8.06.00 DVR:v8.07.00.38.07.4-k1 NPort (fabric via point-to-point) 7:*:*:* qla2xxx 4 Gbit Online QLE2462 FW:v8.06.00 DVR:v8.07.00.38.07.4-k1 NPort (fabric via point-to-point)

:

SCSI HBA Fabric Storage Port


Addr Luns wwnn wwpn portid wwn wwnn wwpn portid info


------------- ---- ------------------/------------------/-------- ------------------ ------------------/------------------/--------/---------


6:0:1:- 67 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x5001438005663d31 0x5001438005663d30 0x0a0500 FCP Target
6:0:2:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x20000024ff0d7d65 0x21000024ff0d7d65 0x010800 FCP Target
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x2000001018d6aa11 0x2001001018d6aa11 0x0a0e01 FCP Initiator
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x200100e08ba7de9a 0x210100e08ba7de9a 0x010600 FCP Initiator
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x20000090fa1927e8 0x10000090fa1927e8 0x0a0100 FCP Initiator
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x20000090fa1927e9 0x10000090fa1927e9 0x0a0000 FCP Initiator
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x20000090fa16f41e 0x10000090fa16f41e 0x010200 FCP Initiator
6:0:x:- - 0x200000e08b87de9a 0x210000e08b87de9a 0x010300 0x100000051e900105 0x20000090fa16f41f 0x10000090fa16f41f 0x010700 FCP Initiator
:
.
SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.