Topic
2 replies Latest Post - ‏2012-02-23T16:56:54Z by Brian_King
gambs
gambs
5 Posts
ACCEPTED ANSWER

Pinned topic Lookup of WWPN from Linux for VFC

‏2012-02-16T22:42:35Z |
Hello,
 
Quick Question.  Can anyone tell me if the WWPN of a Virtual Fibre Channel Adapter (otherwise known as NPIV) is available to Linux, specifically RHEL 6.2?  I know I can look it up on the HMC/IVM and get it from the switch once it's logged in, but I'm surprised I haven't been able to find it within Linux itself.  I've looked several places, including /var/log/messages/, dmesg, /proc, /sys, lscfg, etc.  Perhaps I missed it?  
 
Thank you,
Robert Gambs
Updated on 2012-02-23T16:56:54Z at 2012-02-23T16:56:54Z by Brian_King
  • jscheel
    jscheel
    61 Posts
    ACCEPTED ANSWER

    Re: Lookup of WWPN from Linux for VFC

    ‏2012-02-22T01:09:36Z  in response to gambs
     Robert,
     
    Have you tried these instructions from the x86 Linux InfoCenter:
     

    To locate the WWPN without restarting the host, you can use any of the following methods:

    • For QLogic or Emulex adapters, you can find the WWPN in the /proc/scsi/adapter_type/n directory, where adapter_type is the host adapter type and n is the host adapter number for your card. Your host adapter type can be either qlaxxxx for QLogic adapters or lpfc for Emulex adapters.
    • If you downloaded a QLogic adapter from the QLogic website instead of using the default version that is included with RHEL, to find the WWPN run the cat /proc/scsi/adapter_type/n command, where adapter_type is the host adapter type (for example, qla2xxx or qla2300), and n is the host adapter number for your card.
    • For a QLogic adapter that is included with RHEL 4.x or earlier, to find the WWPN run the cat /proc/scsi/adapter_type/n command, where adapter_type is the host adapter type, and n is the host adapter number for your card. In most cases, the adapter type is qla2xxx.
    • For a QLogic adapter that is included with RHEL 5.x or later, the adapter WWPN information might not be available in the/proc/scsi/adapter_type/n directory because of the migration to sysfs, If so, run the following command:
      cat /sys/class/scsi_host/hostn/device/fchost\:hostn/port_name
      where n is the host adapter number for your card.
    Here's the link where I found this information: http://publib.boulder.ibm.com/infocenter/dsichelp/ds8000ic/topic/com.ibm.storage.ssic.help.doc/f2c_loclinux_192wga.html
     
    I see nothing that would be platform unique in these directions.
  • Brian_King
    Brian_King
    19 Posts
    ACCEPTED ANSWER

    Re: Lookup of WWPN from Linux for VFC

    ‏2012-02-23T16:56:54Z  in response to gambs
    The WWPN for the VFC host can be found in the same location as most physical FC adapters:
     
    cat /sys/class/fc_host/hostX/port_name
     
    In order to support Live Partition Mobility, each VFC host actually has two WWPNs associated with it, only one is active at a time. When zoning your SAN, if you intend to ever do Live Partition Mobility, you will want to ensure you zone both WWPNs. The two WWPNs are consecutive, the first one being an even number, so you can calculate the second WWPN. Alternatively,both WWPNs are also available in the device tree in /proc:
     
    od -x /proc/device-tree/vdevice/vfc-client@300000XX/ibm,port-wwn-1
    od -x /proc/device-tree/vdevice/vfc-client@300000XX/ibm,port-wwn-2
     
    Thanks,
     
    Brian