How To Find Fiber Host Bus Adapter (Fiber HBA) WWN On AIX UNIX

Here are some useful commands for the most popular Linux/Unix operating systems to find your HBA WWN. For brevity sake I am dividing this into a number of posts. I’ve covered Linux, Solaris, and HP-UX. And now… AIX!

Useful stuff I hope, at least to me, because while we all love fiber storage, before it can even get presented to your server your Storage Admin needs to know your server’s HBA’s WWN (whether you are using a fiber switch or plugging directly). So here we go!

AIX cilpart

Oh, and because of strange google search results, you might have come here looking to find info on getting HBA WWN info on a different OS than what is featured here. So a quick run down of what I have available:


Okay onward!!

AIX: Finding Fiber HBA WWN

Here are some useful commands.


Sponsored Links



lsdev -Cc adapter to find the adapter path first.
fcstat [adapter] to get full info
lscfg -vl [adapter] to get abbreviated info

Sometimes fcstat is not available. Never bothered to figure out way, I just move on to the lscfg since that is always available. Like I mentioned, sysadmins are creatures of habit and so I never bothered looking into why fcstat is not always available..


Sponsored Links



For this server, I have three dual port adapters in. But I’ll save you the trouble and just run “fcstat” and “lscfg” on one of them :)

Here is sample output


# lsdev -Cc adapter
cor0 Available 0A-00 GXT145 Graphics Adapter
ent0 Available Logical Host Ethernet Port (lp-hea)
ent1 Available Logical Host Ethernet Port (lp-hea)
ent2 Available Logical Host Ethernet Port (lp-hea)
ent3 Available Logical Host Ethernet Port (lp-hea)
ent4 Available EtherChannel / IEEE 802.3ad Link Aggregation
fcs0 Available 03-00 4Gb FC PCI Express Adapter (df1000fe)
fcs1 Available 03-01 4Gb FC PCI Express Adapter (df1000fe)
fcs2 Available 04-00 4Gb FC PCI Express Adapter (df1000fe)
fcs3 Available 04-01 4Gb FC PCI Express Adapter (df1000fe)
fcs4 Available 06-00 4Gb FC PCI Express Adapter (df1000fe)
fcs5 Available 06-01 4Gb FC PCI Express Adapter (df1000fe)
lhea0 Available Logical Host Ethernet Adapter (l-hea)
sissas0 Available 00-08 PCI-X266 Planar 3Gb SAS RAID Adapter
sissas1 Available 01-08 PCI-X266 Planar 3Gb SAS RAID Adapter
usbhc0 Available 02-08 USB Host Controller (33103500)
usbhc1 Available 02-09 USB Host Controller (33103500)
usbhc2 Available 02-0a USB Enhanced Host Controller (3310e000)
vsa0 Defined LPAR Virtual Serial Adapter
vsa1 Available LPAR Virtual Serial Adapter
vsa2 Available LPAR Virtual Serial Adapter
#

You can tell they are dual port because the hardware paths are

03-00
03-01
04-00
04-01
06-00
06-01

Running our fcstat and lsdev commands:


# fcstat fcs0

FIBRE CHANNEL STATISTICS REPORT: fcs0

Device Type: 4Gb FC PCI Express Adapter (df1000fe) (adapter/pciex/df1000fe)
Serial Number: 1B84204CD5
Option ROM Version: 02E8277F
ZA: Z1F2.70A5
World Wide Node Name: 0x20000000C980DBE8
World Wide Port Name: 0x10000000C980DBE8

FC-4 TYPES:
Supported: 0x0000012000000000000000000000000000000000000000000000000000000000
Active: 0x0000010000000000000000000000000000000000000000000000000000000000
Class of Service: 3
Port Speed (supported): 4 GBIT
Port Speed (running): 4 GBIT
Port FC ID: 0x000001
Port Type: Private Loop

Seconds Since Last Reset: 1219675

Transmit Statistics Receive Statistics
------------------- ------------------
Frames: 203978 407400
Words: 2862592 12623616

LIP Count: 1
NOS Count: 0
Error Frames: 0
Dumped Frames: 0
Link Failure Count: 0
Loss of Sync Count: 4
Loss of Signal: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 7
Invalid CRC Count: 0

IP over FC Adapter Driver Information
No DMA Resource Count: 0
No Adapter Elements Count: 0

FC SCSI Adapter Driver Information
No DMA Resource Count: 0
No Adapter Elements Count: 0
No Command Resource Count: 0

IP over FC Traffic Statistics
Input Requests: 0
Output Requests: 0
Control Requests: 0
Input Bytes: 0
Output Bytes: 0

FC SCSI Traffic Statistics
Input Requests: 203340
Output Requests: 10
Control Requests: 51
Input Bytes: 51849495
Output Bytes: 252
# lscfg -vl fcs0
fcs0 U78AB.001.WZSG050-P1-C3-T1 4Gb FC PCI Express Adapter (df1000fe)

Part Number.................10N7255
Serial Number...............1B84204CD5
Manufacturer................001B
EC Level....................D76626
Customer Card ID Number.....5774
FRU Number.................. 10N7255
Device Specific.(ZM)........3
Network Address.............10000000C980DBE8
ROS Level and ID............02E8277F
Device Specific.(Z0)........2057706D
Device Specific.(Z1)........00000000
Device Specific.(Z2)........00000000
Device Specific.(Z3)........03000909
Device Specific.(Z4)........FFE01212
Device Specific.(Z5)........02E8277F
Device Specific.(Z6)........06E12715
Device Specific.(Z7)........07E1277F
Device Specific.(Z8)........20000000C980DBE8
Device Specific.(Z9)........ZS2.71X15
Device Specific.(ZA)........Z1F2.70A5
Device Specific.(ZB)........Z2F2.71X15
Device Specific.(ZC)........00000000
Hardware Location Code......U78AB.001.WZSG050-P1-C3-T1

#

Other useful stuff

AIX is a beast.

Tame the beast. Here are some other useful commands for discovery

The above commands show you hardware paths for your HBA, in my server specifically:

fcs0 = 03-00
fsc1 = 03-01

fcs2 = 04-00
fcs3 = 04-01

fcs4 = 06-00
fcs5 = 06-01

lsdev -Cc disk

Listing the disks with the hardware path. This can help tell you which disks are talking to which HBA

Another example using “grep”

bash-3.2# lsdev -Cc disk | grep 06-01
hdisk20 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
hdisk21 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
hdisk22 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
hdisk23 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
hdisk24 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
hdisk25 Available 06-01-02 Hitachi MPIO Disk AMS.SMS.WMS (Fibre)
bash-3.2#

These are my PVs that are talking to /dev/fcs5 HBA port.

From there you can use your normal lspv and lsvg commands to find out the mountpoints used by specific LUNS on storage.

lspath Find out multipaths to your storage.

As an example, I pulled a fiber cable and got this output:

bash-3.2# lspath
..
..
Missing hdisk20 fscsi4
Missing hdisk21 fscsi4
Missing hdisk22 fscsi4
Missing hdisk23 fscsi4
Missing hdisk24 fscsi4
Missing hdisk25 fscsi4
Enabled hdisk20 fscsi5
Enabled hdisk21 fscsi5
Enabled hdisk22 fscsi5
Enabled hdisk23 fscsi5
Enabled hdisk24 fscsi5
Enabled hdisk25 fscsi5
bash-3.2#

So you can see the PVs (e.g. hdisk20) are listed twice, which means there are two paths to each of these PVs. And the cable I pulled corresponds to fscsi4 a.k.a. fcs4 which is why the path is “missing”


Sponsored Links

THAT’S ALL FOLKS!!!

If you have any more questions, feel free to contact me and AIX me … (a har har har)

(Did you see what I did there?)

, , , , , Unix

15 thoughts on “How To Find Fiber Host Bus Adapter (Fiber HBA) WWN On AIX UNIX

  1. Great!!! Thanks for sharing the details…

    Very useful information..

    Request to you please explain about the speed of ports. I understand there is HBA card on Storage device & HOST (server) also. (the connection always be with physical Fibre cable wire)

    1) what will be the Storage HBA Ports Speed

    2) what will be the Switch Ports Speed ?

    3) what will be the HOST (server) HBA Ports Speed ?

    4) What is role of SFP port and it’s speed?

    Need to understand about speed and data transfer rate….

    Say example I wanted to transfer or read 150 GB (Giga bytes) data or file from Storage to Host (server). So how much time required to complete my request.

    Whether Data Transfer speed is depend on Physical Fibre optic wire or HBA port?

    Or it’s depend on switch port?

    Thanks in advance.

    Yousuf,

    • Hello, thanks for your comments! Sorry for the late reply. For your questions:

      > 1) what will be the Storage HBA Ports Speed

      You will need to look at your storage manager software to find out what the storage HBA is at (e.g. for IBM storage like DS4700, use the Storage Manager Client software. For Hitachi, it’s the Storage Navigator Modular, etc.)

      > 2) what will be the Switch Ports Speed ?

      That is set on the switch.

      > 3) what will be the HOST (server) HBA Ports Speed ?

      Look at the “Port Speed” (both supported and running) from “fcstat”. In my above example:

      Port Speed (supported): 4 GBIT
      Port Speed (running): 4 GBIT

      Note the supported speed and running speed may be different. You want the switch and your system’s fiber port to be set to the same (or auto which means it will be “auto-negotiated” or “automatically set”). Sometimes auto-negotiation sets the port speed lower than is supported so if that’s the case you may want to fix it to the top speed. You want your system, your switch, and your storage to all be the same speed.

      > 4) What is role of SFP port and it’s speed?

      This is how fast the data will transfer. Generally you want it to be at the fasted supported rate for all devices.

      > Say example I wanted to transfer or read 150 GB (Giga bytes) data or file from Storage to Host (server). So how much time required to complete my request. Whether Data Transfer speed is depend on Physical Fibre optic wire or HBA port?

      Most fiber channel speed support is fixed at 2gbps, 4gpbs, 8gpbs, etc. So it’s better to use those numbers in your calculations to find out how fast it will transfer, then figure out if that is within your requirements.

      An approximation of theoretical fastest speed:

      2gbps ~ .25GB/s. 150GB will take ~ 600s = 10 min
      4gbps ~ .50GB/s. 150GB will take ~ 300s = 5 min
      8gpbs ~ 1.00GB/s. 150GB will take ~ 150s = 2.5 min
      16gbps ~ 2.00GB/s. 150GB will take ~ 75s = 1min15sec

      These are theoretical max. Actual times will be slower, but you can use these for relative calculations.

      Good luck!

  2. Hi,
    I have hard time understanding the
    `lsdev -vpd -dev fcs0`

    command output. Could you please point out on where to look on how to translate “Device specific(Zx)” output?

    Basically I’m trying to find such information regarding Fibre Channel adapters:
    * driver version
    * firmware version
    * vendor

    The problem is that I have only rksh as a shell, so no lscfg/lsattr/etc like commands are available.
    At the same time lsdev and fcstat are available

    Env: AIX 6.1
    ioslevel: 2.2.1.0

    Thanks in advance,
    Eugene

    • Hi, not sure the command you typed is valid: “lsdev -vpd -dev fcs0″

      Do you have access to prtconf? If so, you can use “prtconf -v”. If you look through the output you should find something similar to the “lscfg” output

      fcs0 U789F.001.AAA2859-P1-C13-C1-T1 FC Adapter

      Part Number……………..10N8620
      Serial Number……………1B723048B8
      Manufacturer…………….001B
      EC Level………………..A
      Customer Card ID Number…..5758
      FRU Number……………… 10N8620
      ..
      .. etc
      ..

      Part number or FRU number will give you vendor and more info

      Driver will be integrated with the OS. Use the output from “fcstat”

      Device Type: 4Gb FC PCI Express Adapter (df1000fe) (adapter/pciex/df1000fe)

      And then look at “lslpp -l” and look for the string “df10000fe” and you’ll see the driver info

      Does that help?

  3. Is there any way to determine the WWN of a mounted volume? I know my LUN has a WWN that identifies it on the array – how can I determine which volume on AIX has which WWN?

    • Joel: You can tell, it takes a bit of work. This was going to be the subject of a new blog post (which tells you that it is at least some minimum difficulty level).

      Here it is in a nutshell are a few command to get you started, all output is hypothetical (made up a few of the non-relevant numbers for security reasons)

      Working backwards, find out the LV of the mounted volume and from there find the VG that contains that LV.

      You can use “lslv” and “lsvg” commands to find this out. e.g.

      # lsvg -l data01
      data01:
      LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
      data1 jfs2 100 100 1 open/syncd /data1
      data2 jfs2 100 100 1 open/syncd /data2
      data3 jfs2 100 100 1 open/syncd /data3
      data4 jfs2 100 100 1 open/syncd /data4
      logdata01 jfs2log 1 1 1 open/syncd N/A

      So let’s say I’m interested in /data1

      It’s possible it may be spread out amongst different PVs.

      # lslv -l data1
      PV COPIES IN BAND DISTRIBUTION
      hdisk2 500:000:000 10% 100:100:100:100:100

      In this case, all of the LV is on one PV.

      /data1 -> data1(LV) -> hdisk2(PV)

      Find out the hdisk in your vg (optional)
      # lspv
      hdisk0 00cfde8adf000000 rootvg active
      hdisk1 00cfde8afd000001 rootvg active
      hdisk2 00cfde8a000000e72 data01 active
      hdisk3 00cfde8a000000e76 data01 active
      hdisk4 00cfde8a000000e78 data01 active
      hdisk5 00cfde8a000000e82 data01 active

      Find out the hardware path
      # lsdev -Cc disk
      hdisk0 Available 00-00-00-5,0 16 Bit LVD SCSI Disk Drive
      hdisk1 Available 00-00-00-8,0 16 Bit LVD SCSI Disk Drive
      hdisk2 Available 03-00-01 1722-600 (600) Disk Array Device
      hdisk3 Available 03-01-01 1722-600 (600) Disk Array Device
      hdisk4 Available 04-00-01 1722-600 (600) Disk Array Device
      hdisk5 Available 04-01-01 1722-600 (600) Disk Array Device

      Notice the paths in the third column, e.g. “03-00-01″ path

      Now find the corresponding path for your fiber card

      # lsdev -Cc adapter

      fcs0 Available 03-00 4Gb FC PCI Express Adapter ()
      fcs1 Available 03-01 4Gb FC PCI Express Adapter ()
      fcs2 Available 04-00 4Gb FC PCI Express Adapter ()
      fcs3 Available 04-01 4Gb FC PCI Express Adapter ()

      (from this you can see we have two dual-port HBA)

      So we have identified
      /data1 -> data1(LV) -> hdisk2(PV) -> 03-00-01 -> fcs0

      From there you can use “lscfg -vl fcsN” or “fcstat fcsN” as described in the blog post to get the WWN. e.g. fcstat fcs0

      Now realize you may end up having your mount point on two WWN in the case that it’s possible your LUN traverses two hdisks, and those two hdisks are on two separate paths.

      Example:

      # lslv -l data1
      PV COPIES IN BAND DISTRIBUTION
      hdisk2 500:000:000 10% 100:100:100:100:100
      hdisk4 500:000:000 10% 100:100:100:100:100

      And
      hdisk2 -> 03-00-01 -> fcs1
      hdisk4 -> 04-00-01 -> fcs3

      So you will have two WWNs for this one filesystem

      Make sense? Good luck!

  4. Hi Ben,

    Thanks for such a useful information that you have given. your explanation is easy to understand. i have tried hard to understand the answers for below questions…..but still not clear

    1) i want know about t factor and x factor?
    2) How we can use it?
    3) what is the exact use of multipathing and how we can configure it?

  5. How can i find the wwn of the lun to which my hdiskXX belong? one lun can be exposed to adapter (fcsX) through two ports , we can get wwpn through “lsattr -El hdiskXX”, but how to find the wwn of the lun to which both the hdiskXX belong?

    • Sorry for the delayed response! Just now found some comments marked as “spam” so I just approved them so I can respond. (hopefully you figured it out already!)

      Two helpful commands

      # lslv [LVNAME]

      Gives you properties of the LV. You can look for the “VOLUME GROUP: [vgname]” info there.

      e.g.

      TESTAIX:/ > lslv hd9var
      LOGICAL VOLUME: hd9var VOLUME GROUP: rootvg
      LV IDENTIFIER: 0007b8420000d9000000011d44225596.6 PERMISSION: read/write
      VG STATE: active/complete LV STATE: opened/syncd
      TYPE: jfs2 WRITE VERIFY: off
      MAX LPs: 512 PP SIZE: 128 megabyte(s)
      COPIES: 1 SCHED POLICY: parallel
      LPs: 4 PPs: 4
      STALE PPs: 0 BB POLICY: relocatable
      INTER-POLICY: minimum RELOCATABLE: yes
      INTRA-POLICY: center UPPER BOUND: 32
      MOUNT POINT: /var LABEL: /var
      MIRROR WRITE CONSISTENCY: on/ACTIVE
      EACH LP COPY ON A SEPARATE PV ?: yes
      Serialize IO ?: NO
      TESTAIX:/ >

      Second command, going the other way,
      # lsvg -l [vgname]

      Will give you all the LUNS of a VG

      e.g.

      TESTAIX:/ > lsvg -l rootvg
      rootvg:
      LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
      hd5 boot 1 1 1 closed/syncd N/A
      hd6 paging 64 64 1 open/syncd N/A
      hd8 jfs2log 1 1 1 open/syncd N/A
      hd4 jfs2 2 2 1 open/syncd /
      hd2 jfs2 16 16 1 open/syncd /usr
      hd9var jfs2 4 4 1 open/syncd /var
      hd3 jfs2 8 8 1 open/syncd /tmp
      hd1 jfs2 16 16 1 open/syncd /home
      hd10opt jfs2 16 16 1 open/syncd /opt
      lg_dumplv sysdump 8 8 1 open/syncd N/A
      u01 jfs2 120 120 1 open/syncd /u01
      fslv00 jfs2 40 40 1 closed/syncd /spinstall
      TESTAIX:/ >

      Hope that helps!

    • Hi, sorry for the late response, just found these commetns in my “SPAM” box in wordpress so approving them now so I can answer. Hopefully you figured it out already

      I don’t know what an NAA identifier is. Basically for me identifying LUNS is tribal knowledge when it comes to AIX. I haven’t found a definitive way to do it

      You look at the LUNS on the SAN, they each have an ID when being presented, and that’s the order the AIX box will scan them in. So theoretically they should all be in order

      Assuming you have hdisk0 and hdisk1 in your chassis, and then 5 LUNS allocated from SAN, then the first LUN (usually LUN ID 0 on SAN or something of that convention) will be hdisk2. Second LUN from SAN (LUN ID 1) would be hdisk3. And so on

      For more info, you would need the vendor’s software since it can communicate with its own SAN. As an example, using emc’s powerpath commands for an EMC storage, or xiv_devlist for IBM XIV storage. That will give you a lot more info then using the native AIX tools.

      So if 3PAR has an AIX client, you would want to use that.

      Hope that helps.

    • Sorry haven’t responded to this. I don’t have any LPARs to test on, I have a few in production but I cannot reboot them. I have, however, rebooted the servers for maintenance and all my disks came up fine so I’m assuming all my WWNs are coming back up fine.

      Might have to talk to IBM or log into your VIO to see if there are logs. From my limited knowledge, the HBAs are not virtual, they are actual physical maps so it shouldn’t change. So that’s a strange one. Sorry don’t know much about that one.

  6. How to check which fcs adapter is connected to which HBA ?
    we have four fcs adapters like fcs0 fsc1 … etc
    i would like to check which fcs is connected to which HBA.

    • You can run the command “lscfg | grep fcs” to get an output of the physical path names. So assuming I have two HBAs, both are dual port, I should see something similar to:

      fcs0 U787B.001.WMW8950-P1-C1-T1 FC AdapterPart Number……………..03N6439
      fcs1 U787B.001.WMW8950-P1-C1-T2 FC AdapterPart Number……………..03N6439
      fcs2 U787B.001.WMW8950-P1-C2-T1 FC AdapterPart Number……………..03N6439
      fcs3 U787B.001.WMW8950-P1-C2-T2 FC AdapterPart Number……………..03N6439

      The important part above is the “P1-C1-T1″

      The “C” corresponds to a slot in your pSeries chassis. In fact you should be able to go physically to the chassis and look on the back and the slots are labeled on the outside. I believe most p-Series chassis have 8 slots total and they are labeled C0 through C7.

      The next part is a bit tricky. Most of the time, the top HBA port is T1 adn the bottom HBA port is T2. You will need to consult your HBA manufacturer’s manual to confirm. Sometimes the HBA is physically labeled with some sort of numbers like “Port 0″ and “Port 1″. If that’s the case, generally in good confidence the lower numbered port would correspond to “T1″ and the higher numbered port would correspond to “T2″. The only way to determine this with 99.5% confidence is consult the manufacturer manual to see. And with 100% confidence would be to actually pull the cables and check your fiber switch or storage GUI to see what went disconnected.

      100% you can at least determine the system board slot though which is extremely helpful (the C0 through C7)

      Hope that helps.

Leave a Comment

Your email address will not be published. Required fields are marked *

Spam protection by WP Captcha-Free