Silly SAN tricks – finding the WWN of an HBA from Solaris
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.