Wednesday 9 January 2013

How to find HBA details in AIX, Solaris, Linux, HP-UX , ESX & Windows

For a person who works on Storage, its  mandatory   to know the HBA details of the host servers.And when you are working on many flavors of OS, its difficult to remember all the commands. This is making me to write & post such an article. I hope this will be helpful for people working on Storage as well as on Servers.

This article will help Storage admins as well as Sys Admins to find details like port speed, wwn no., vendor make and some important other details of HBA cards inserted in their servers installed with IBM AIX, Oracle SOLARIS, HP-UX, Red-hat LINUX and  ESX.
The below mentioned commands should display FCOE card details too if its present in the server.

1) IBM AIX 

*  First find how many HBA adapters are there using the command "lscfg"
------------------------------------------------------------------------
bash-4.0# lscfg | grep "FC Adapter"
+ fcs1             U787A.001.DPM1VHX-P1-C6-T1                                    FC Adapter
+ fcs0             U787A.001.DPM1VHX-P1-C1-T1                                    FC Adapter

*  Now we can find the wwn no. of each Adapter card using "lscfg" command (the wwn no. is highlighted in red color )
--------------------------------------------------------------------------------

bash-4.0# lscfg -vpl fcs0
  fcs0             U787A.001.DPM1VHX-P1-C1-T1  FC Adapter

        Part Number.................00P4295
        EC Level....................A
        Serial Number...............1D4150C817
        Manufacturer................001D
        Customer Card ID Number.....5704
        FRU Number..................     00P4297
        Device Specific.(ZM)........3
        Network Address.............10000000C93E2359
        ROS Level and ID............02E01871
        Device Specific.(Z0)........2003806D
        Device Specific.(Z1)........00000000
        Device Specific.(Z2)........00000000
        Device Specific.(Z3)........03000909
        Device Specific.(Z4)........FF601231
        Device Specific.(Z5)........02E01871
        Device Specific.(Z6)........06631871
        Device Specific.(Z7)........07631871
        Device Specific.(Z8)........20000000C93E2359
        Device Specific.(Z9)........HS1.81X1
        Device Specific.(ZA)........H1D1.81X1
        Device Specific.(ZB)........H2D1.81X1
        Device Specific.(ZC)........00000000
        Hardware Location Code......U787A.001.DPM1VHX-P1-C1-T1


  PLATFORM SPECIFIC

  Name:  fibre-channel
    Model:  LP9802
    Node:  fibre-channel@1
    Device Type:  fcp
    Physical Location: U787A.001.DPM1VHX-P1-C1-T1


bash-4.0# lscfg -vpl fcs1
  fcs1             U787A.001.DPM1VHX-P1-C6-T1  FC Adapter

        Part Number.................00P4295
        EC Level....................A
        Serial Number...............1D4150C1D6
        Manufacturer................001D
        Customer Card ID Number.....5704
        FRU Number..................     00P4297
        Device Specific.(ZM)........3
        Network Address.............10000000C93E1D18
        ROS Level and ID............02E01871
        Device Specific.(Z0)........2003806D
        Device Specific.(Z1)........00000000
        Device Specific.(Z2)........00000000
        Device Specific.(Z3)........03000909
        Device Specific.(Z4)........FF601231
        Device Specific.(Z5)........02E01871
        Device Specific.(Z6)........06631871
        Device Specific.(Z7)........07631871
        Device Specific.(Z8)........20000000C93E1D18
        Device Specific.(Z9)........HS1.81X1
        Device Specific.(ZA)........H1D1.81X1
        Device Specific.(ZB)........H2D1.81X1
        Device Specific.(ZC)........00000000
        Hardware Location Code......U787A.001.DPM1VHX-P1-C6-T1


  PLATFORM SPECIFIC

  Name:  fibre-channel
    Model:  LP9802
    Node:  fibre-channel@1
    Device Type:  fcp
    Physical Location: U787A.001.DPM1VHX-P1-C6-T1


*******************************************************************************

2) ORACLE SOLARIS 

* First check how many HBA ports are there and if they are connected or not using luxadm command
------------------------------------------------------------------------------------------------------
bash-3.00# luxadm -e port
/devices/pci@1d,700000/emlx@1/fp@0,0:devctl                        NOT CONNECTED
/devices/pci@1d,700000/emlx@1,1/fp@0,0:devctl                      CONNECTED

*  Now using fcinfo command we can get the wwn no. of hba cards.(the wwn no. is highlighted in green color)
---------------------------------------------------------------------

bash-3.00# fcinfo hba-port
HBA Port WWN: 10000000c955dd7c
        OS Device Name: /dev/cfg/c3
        Manufacturer: Emulex
        Model: LP11002-E
        Firmware Version: 2.10a10 (B2F2.10A10)
        FCode/BIOS Version: Boot:3.01a1 Fcode:3.01a1
        Serial Number: BG62327522
        Driver Name: emlxs
        Driver Version: 2.31p (2008.12.11.10.30)
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: not established
        Node WWN: 20000000c955dd7c
HBA Port WWN: 10000000c955dd7d
        OS Device Name: /dev/cfg/c1
        Manufacturer: Emulex
        Model: LP11002-E
        Firmware Version: 2.10a10 (B2F2.10A10)
        FCode/BIOS Version: Boot:3.01a1 Fcode:3.01a1
        Serial Number: BG62327522
        Driver Name: emlxs
        Driver Version: 2.31p (2008.12.11.10.30)
        Type: N-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 4Gb
        Node WWN: 20000000c955dd7d

*********************************************************************************

3) HP-UX

* first find how many hba cards are inserted in the host using ioscan command
-------------------------------------------------------------------------------

bash-4.2# ioscan -fnC fc
Class     I  H/W Path  Driver S/W State   H/W Type     Description
================================================================
fc        0  0/5/1/0   fcd   CLAIMED     INTERFACE    HP AB379-60101 4Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                      /dev/fcd0
fc        1  0/5/1/1   fcd   CLAIMED     INTERFACE    HP AB379-60101 4Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 2)
                      /dev/fcd1

 * Now for each card we can find the wwn detail using fcmsutil command
 -----------------------------------------------------------------------
bash-4.2# fcmsutil /dev/fcd0

                           Vendor ID is = 0x1077
                           Device ID is = 0x2422
            PCI Sub-system Vendor ID is = 0x103C
                   PCI Sub-system ID is = 0x12D7
                               PCI Mode = PCI-X 266 MHz
                       ISP Code version = 5.4.0
                       ISP Chip version = 3
                               Topology = PTTOPT_FABRIC
                             Link Speed = 4Gb
                     Local N_Port_id is = 0x65000e
                  Previous N_Port_id is = None
            N_Port Node World Wide Name = 0x5001438001328edd
            N_Port Port World Wide Name = 0x5001438001328edc
            Switch Port World Wide Name = 0x20c4000dec8224c0
            Switch Node World Wide Name = 0x100008008804fc9e
              N_Port Symbolic Port Name = hostname_fcd0
              N_Port Symbolic Node Name = hostname_HP-UX_B.11.31
                           Driver state = ONLINE
                       Hardware Path is = 0/5/1/0
                     Maximum Frame Size = 2048
         Driver-Firmware Dump Available = NO
         Driver-Firmware Dump Timestamp = N/A
                                   TYPE = PFC
                         NPIV Supported = YES
                         Driver Version = @(#) fcd B.11.31.1103 Dec  6 2010

bash-4.2# fcmsutil /dev/fcd1

                           Vendor ID is = 0x1077
                           Device ID is = 0x2422
            PCI Sub-system Vendor ID is = 0x103C
                   PCI Sub-system ID is = 0x12D7
                               PCI Mode = PCI-X 266 MHz
                       ISP Code version = 5.4.0
                       ISP Chip version = 3
                               Topology = PTTOPT_FABRIC
                             Link Speed = 4Gb
                     Local N_Port_id is = 0x65000f
                  Previous N_Port_id is = None
            N_Port Node World Wide Name = 0x5001438001328edf
            N_Port Port World Wide Name = 0x5001438001328ede
            Switch Port World Wide Name = 0x20c6000dec8224c0
            Switch Node World Wide Name = 0x100008008804fc9e
              N_Port Symbolic Port Name = hostname_fcd1
              N_Port Symbolic Node Name = lhostname_HP-UX_B.11.31
                           Driver state = ONLINE
                       Hardware Path is = 0/5/1/1
                     Maximum Frame Size = 2048
         Driver-Firmware Dump Available = NO
         Driver-Firmware Dump Timestamp = N/A
                                   TYPE = PFC
                         NPIV Supported = YES
                         Driver Version = @(#) fcd B.11.31.1103 Dec  6 2010


*********************************************************************************

4) Red-hat  LINUX

* First identify the no. of HBA cards and their types by lspci command
-----------------------------------------------------------------------

bash# lspci |grep -i fibre
0a:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
0a:00.1 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
0e:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 02)
0e:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 02)

* We can find the wwn no. from the respective files
---------------------------------------------------

bash# more /sys/class/fc_host/host0/port_name
0x210000e08b871816
bash# more /sys/class/fc_host/host1/port_name
0x210100e08ba71816
bash# more /sys/class/fc_host/host7/port_name
0x10000000c9893356
bash# more /sys/class/fc_host/host8/port_name
0x10000000c9893357


There is another method to find the hba wwn details by installing a package called sysfutils

  rpm -ivh libsysfs-2.1.0-6.1.el6.x86_64.rpm
  rpm -ivh sysfsutils-2.1.0-6.1.el6.x86_64.rpm

or 

  yum install sysfsutils


bash# systool -c fc_host -v -d host0
0x210000e08b871816
bash# systool -c fc_host -v -d host1
0x210100e08ba71816
bash# systool -c fc_host -v -d host7
0x10000000c9893356
bash# systool -c fc_host -v -d host8
0x10000000c9893357

*********************************************************************************

5) ESX- VMware


We can find the wwn no.s of the hba from the file "/proc/scsi/qla2xxx/X" where X is the no. of card

~ # more /proc/scsi/qla2xxx/7
QLogic PCI to Fibre Channel Host Adapter for QLE2562:
        FC Firmware version 5.03.15 (d5), Driver version 901.k1.1-14vmw

Host Device Name vmhba4

BIOS version 2.02
FCODE version 2.00
EFI version 2.00
Flash FW version 4.03.01
ISP: ISP2532
Request Queue = 0x81810000, Response Queue = 0x81851000
Request Queue count = 2048, Response Queue count = 512
Number of response queues for multi-queue operation: 0
Total number of interrupts = 72
    Device queue depth = 0x40
Number of free request entries = 2048
Total number of outstanding commands: 0
Number of mailbox timeouts = 0
Number of ISP aborts = 0
Number of loop resyncs = 1
Host adapter:Loop State = <DEAD>, flags = 0x1a268
Link speed = <Unknown>

Dpc flags = 0x100c0
Link down Timeout =  045
Port down retry =   005
Login retry count =   008
Execution throttle = 2048
ZIO mode = 0x6, ZIO timer = 1
Commands retried with dropped frame(s) = 0
Product ID = 4953 5020 2532 0002


NPIV Supported : Yes
Max Virtual Ports = 254

SCSI Device Information:
scsi-qla0-adapter-node=20000024ff282188:000000:0;
scsi-qla0-adapter-port=21000024ff282188:000000:0;

FC Target-Port List:

~ # more /proc/scsi/qla2xxx/8
QLogic PCI to Fibre Channel Host Adapter for QLE2562:
        FC Firmware version 5.03.15 (d5), Driver version 901.k1.1-14vmw

Host Device Name vmhba5

BIOS version 2.02
FCODE version 2.00
EFI version 2.00
Flash FW version 4.03.01
ISP: ISP2532
Request Queue = 0x8188e000, Response Queue = 0x818cf000
Request Queue count = 2048, Response Queue count = 512
Number of response queues for multi-queue operation: 0
Total number of interrupts = 72
    Device queue depth = 0x40
Number of free request entries = 2048
Total number of outstanding commands: 0
Number of mailbox timeouts = 0
Number of ISP aborts = 0
Number of loop resyncs = 1
Host adapter:Loop State = <DEAD>, flags = 0xa268
Link speed = <Unknown>

Dpc flags = 0x100c0
Link down Timeout =  045
Port down retry =   005
Login retry count =   008
Execution throttle = 2048
ZIO mode = 0x6, ZIO timer = 1
Commands retried with dropped frame(s) = 0
Product ID = 4953 5020 2532 0002


NPIV Supported : Yes
Max Virtual Ports = 254

SCSI Device Information:
scsi-qla1-adapter-node=20000024ff282189:000000:0;
scsi-qla1-adapter-port=21000024ff282189:000000:0;

FC Target-Port List:


*********************************************************************************

5) Windows


Windows Server 2012 R2:
From Power Shell:
Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace "root\WMI" | ForEach-Object {(($_.NodeWWN) | ForEach-Object {"{0:x}" -f $_}) -join ":"}

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator.DS1> Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace "root\WMI" | ForEach-Object {
(($_.NodeWWN) | ForEach-Object {"{0:x}" -f $_}) -join ":"}
20:0:0:24:ff:54:91:60
20:0:0:24:ff:54:91:61