UNIX Consulting and Expertise
Golden Apple Enterprises Ltd. » Posts for tag 'wwn'

Finding the WWN in an inactive HBA in Solaris Comments Off on Finding the WWN in an inactive HBA in Solaris

Looking for UNIX and IT expertise? Why not get in touch and see how we can help?

So, Solaris comes with lots of nice tools for querying our SAN HBAs, but the ones we’ve looked at so far are only of any real use when the HBA has a live connection to it.

What about when we want to find the WWN to setup our SAN, before we’ve plugged any fibre in?

picl is a hardware monitoring daemon in Solaris. I first started playing with it on mid-frame and high-end machines (SF6500s and F15ks) where the system controller (SC) talked to picl to do hardware monitoring of a Solaris domain.

We can talk to picl ourselves with prtpicl. We need the verbose option to get something useful, but be warned – this will dump out pages and pages of stuff – so we need to filter it a bit with grep.

[email protected]>prtpicl -v | grep wwn
              :node-wwn  20  00  00  e0  8b  1e  a9  ef 
              :port-wwn  21  00  00  e0  8b  1e  a9  ef 
              :node-wwn  20  00  00  e0  8b  3e  a9  ef 
              :port-wwn  21  01  00  e0  8b  3e  a9  ef 
              :node-wwn  20  00  00  e0  8b  80  9c  a8 
              :port-wwn  21  00  00  e0  8b  80  9c  a8 
              :node-wwn  20  00  00  e0  8b  a0  9c  a8 
              :port-wwn  21  01  00  e0  8b  a0  9c  a8 
              :node-wwn  20  00  00  03  ba  db  e9  89 
              :port-wwn  21  00  00  03  ba  db  e9  89 
                      :node-wwn  20  00  00  00  87  83  fd  1c 
                      :port-wwn  21  00  00  00  87  83  fd  1c 
                      :node-wwn  20  00  00  00  87  84  4a  d8 
                      :port-wwn  21  00  00  00  87  84  4a  d8 

These are the node WWNs that we’re after, with the first one being c2, the second c3, and so on. The internal controller is last, and we can see the WWNs of the two FC disks that are hanging off it. (Remember, on a V490 we have internal FC-AL disks, not SCSI).

Finally, for our last trick, if we have Solaris 10 01/06 or later, we can use the awesome fcinfo command, which makes all of this very, very easy indeed.

[email protected] # fcinfo hba-port
HBA Port WWN: 210000e08b1ea9ef
        OS Device Name: /dev/cfg/c2
        Manufacturer: QLogic Corp.
        Model: QLE2460
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb 4Gb 
        Current Speed: not established 
        Node WWN: 200000e08b1ea9ef

Easy! Another good reason for upgrading to Solaris 10 – there are lots of nice tools and new features like this that make the day to day administration much easier.

Finding the WWN in Solaris followup – making it easier Comments Off on Finding the WWN in Solaris followup – making it easier

Looking for UNIX and IT expertise? Why not get in touch and see how we can help?

In the previous post I listed the ‘long way round’ to find out the WWN from active HBA links in Solaris. The commands I listed before will work on all recent releases of Solaris. If you’re able to migrate to Solaris 10, you can make things easier for yourself.

cfgadm will take a verbose flag, which will print out a listing that includes the full device path. This will definitely work on Solaris 9 and 10 – I’m afraid I don’t have an 8 box to test though.

bash-3.00# cfgadm -lv 
Ap_Id                          Receptacle   Occupant     Condition  Information
When         Type         Busy     Phys_Id
c0                             connected    configured   unknown
unavailable  scsi-bus     n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:scsi
c1                             connected    configured   unknown
unavailable  scsi-bus     n        /devices/[email protected]/[email protected]/[email protected]/[email protected],2/LSILogic,[email protected]:scsi
c2                             connected    configured   unknown
unavailable  fc-private   n        /devices/[email protected]/[email protected]/[email protected]/SUNW,[email protected]/[email protected],0:fc
c3                             connected    unconfigured unknown
unavailable  fc           n        /devices/[email protected]/[email protected]/[email protected]/SUNW,[email protected],1/[email protected],0:fc
c4                             connected    configured   unknown
unavailable  fc-private   n        /devices/[email protected]/[email protected]/[email protected]/SUNW,[email protected]/[email protected],0:fc
c5                             connected    unconfigured unknown
unavailable  fc           n        /devices/[email protected]/[email protected]/[email protected]/SUNW,[email protected],1/[email protected],0:fc
usb0/1                         empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:1
usb0/2                         empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:2
usb1/1.1                       empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:1.1
usb1/1.2                       empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:1.2
usb1/1.3                       empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:1.3
usb1/1.4                       empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:1.4
usb1/2                         empty        unconfigured ok
unavailable  unknown      n        /devices/[email protected]/[email protected]/[email protected]/[email protected]/[email protected]:2

If you have Solaris 10 8/07 or later, then you’ll find that the dump_map option to luxadm will take the short notation for an HBA that cfgadm uses.

bash-3.00# luxadm -e dump_map /dev/cfg/c2
Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
0     1   7d    0      210000e08b86f840 200000e08b86f840 0x1f (Unknown Type,Host Bus Adapter)
1     ad  23    ad     50060e8014118960 50060e8014118960 0x0  (Disk device)

Again, this all works only if the HBA has a live link – it needs some cable plugged in, and you need to have something listening at the other end. I’ll be exploring how to find the WWN of your HBAs – even if they’re not plugged in – soon, using some other features of Solaris.

Silly SAN tricks – finding the WWN of an HBA from Solaris Comments Off on Silly SAN tricks – finding the WWN of an HBA from Solaris

Looking for UNIX and IT expertise? Why not get in touch and see how we can help?

When connecting a Solaris machine to a SAN, you’ll usually need to know the WWN of the host bus adapter (HBA). WWNs are a bit like MAC addresses for ethernet cards – they are unique, and they’re used to manage who is connected to what, and what they can see.

The quickest and easiest way to check the WWN is when we have an active HBA. We can use the cfgadm command under Solaris to check our adapter states:

[email protected]>cfgadm -al
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0                 CD-ROM       connected    configured   unknown
c1                             fc-private   connected    configured   unknown
c1::210000008783fd1c           disk         connected    configured   unknown
c1::2100000087844ad8           disk         connected    configured   unknown
c2                             fc-private   connected    configured   unknown
c2::50060e8014118920           disk         connected    configured   unknown
c3                             fc           connected    unconfigured unknown
c4                             fc-private   connected    configured   unknown
c4::50060e8014118930           disk         connected    configured   unknown
c5                             fc           connected    unconfigured unknown
usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb0/3                         unknown      empty        unconfigured ok
usb0/4                         unknown      empty        unconfigured ok

So both our controllers, c2 and c4, have active loops. Now we can use luxadm to query the driver and print out the device paths for each port on each HBA:

[email protected]>luxadm qlgc
 Found Path to 5 FC100/P, ISP2200, ISP23xx Devices
 Opening Device: /devices/[email protected],700000/SUNW,[email protected]/[email protected],0:devctl
  Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04
 Opening Device: /devices/[email protected],700000/SUNW,[email protected],1/[email protected],0:devctl
  Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04
 Opening Device: /devices/[email protected],700000/SUNW,[email protected]/[email protected],0:devctl
  Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04
 Opening Device: /devices/[email protected],700000/SUNW,[email protected],1/[email protected],0:devctl
  Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04
 Opening Device: /devices/[email protected],600000/SUNW,[email protected]/[email protected],0:devctl
  Detected FCode Version:       ISP2200 FC-AL Host Adapter Driver: 1.15 04/03/22
  Complete

This particular machine I’m playing on is a Sun v490, which uses internal FC-AL disks – so the sixth controller port we can see (the ISP2200) is the internal controller for the internal root disks. Why the sixth? Due to the way the V490 initialises itself, the internal controller is tested and configured after all the PCI slots.

Also, if you look at the device path, you can see it’s coming from a different PCI bus – [email protected] as opposed to [email protected]

Finally, the FCode and driver version are different, which shows us it’s a slightly different chipset from the other HBAs.

REMEMBER: numbering starts from the top (the first device) down. So:

/devices/[email protected],700000/SUNW,[email protected]/[email protected],0:devctl is c2

/devices/[email protected],700000/SUNW,[email protected],1/[email protected],0:devctl is c3

/devices/[email protected],700000/SUNW,[email protected]/[email protected],0:devctl is c4

/devices/[email protected],700000/SUNW,[email protected],1/[email protected],0:devctl is c5

/devices/[email protected],600000/SUNW,[email protected]/[email protected],0:devctl is c1, our internal HBA

We can now use the dump_map option from [email protected] to print out the device map, as seen from each port.

For c2, for example, we would do:

[email protected]>luxadm -e dump_map  /devices/[email protected],700000/SUNW,[email protected]/[email protected],0:devctl
Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
0     1   7d    0      210000e08b1ea9ef 200000e08b1ea9ef 0x1f (Unknown Type,Host Bus Adapter)
1     b1  21    b1     50060e8014118920 50060e8014118920 0x0  (Disk device)

And there is our listing of WWNs. The 50060e8014118920 WWN belongs to our SAN device at the other end (note the type of ‘0x0 Disk device’), and the first WWN of 210000e08b1ea9ef is for our HBA.

Note that this just works for cards which have an active connection to a SAN fabric. If we haven’t plugged them in yet, we need to use some lower level Solaris tools, which I’ll be covering in another post.

Top of page / Subscribe to new Entries (RSS)