How to reset HBA and How to find WWNN & WWPN



A. To get List of HBA card installed on server :


#lspci | grep -i fibre


B. To View used HBA ports on server:

#ls -lrt /sys/class/fc_transport/

drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:2
drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:1
drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:0
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:2
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:1
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:0


From the above o/p we can confirm the HBA ports 7 and 5 used on this server.

Or 

# powermt display dev=all


==============================================================================
---------------- Host ---------------   - Stor -   -- I/O Path -  -- Stats ---
###  HW Path                I/O Paths    Interf.   Mode    State  Q-IOs Errors
==============================================================================
   7 lpfc                      sdai      SP B3     active  alive      0      0
   7 lpfc                      sdat      SP A2     active  alive      0      0
   5 lpfc                      sde       SP B2     active  alive      0      0
   5 lpfc                      sdp       SP A3     active  alive      0      0
================================================================================


From the above powermt output is showing the "HBA path" which is used to connect the storage disk. 7 & 5 used.


C. To find WWNN and WWPN number



#cd /sys/class/fc_host/host??

#cat port_name

#cat node_name


Method 2 :


#cat /sys/class/scsi_host/host??/device/fc_host:host??/port_name 


Method 3:

#cat /proc/scsi/adapter-type/host-number

adapter-type : May be qlaxxxx for QLogic adapters (or) lpfc for Emulex adapters


you will get  the port and node numbers like below:


SCSI Device Information:
scsi-qla1-adapter-node=2001001b32a5018f;
scsi-qla1-adapter-port=2101001b32a5018f;

Method 4: 


There is another method to find the hba wwn details by using the 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



  Then run the below command to get the WWNN and WWPN number


 #systool -c fc_host -v -d host0


D. How to reset HBA without reboot server


#echo > "0" /sys/class/scsi_host/host#/board_online

#echo > "1" /sys/class/scsi_host/host#/board_online

#echo > "- - -" /sys/class/scsi_host/host#/scan


If power path is used on server then run below command 


# powermt config


If multipath is used on server then run below command

# multipath -v2







0 comments:

Post a Comment

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks