Posts tagged ·

HBA

·...

A handy tool to check SAN port/ FC adapter / cable connection from AIX command line

Comments Off

A little toolset IBM has provided for checking if SAN port/ FC adapter / cable are broken, it is really handy if you are working remotely.

 

1. Download efc_power.tar file or request the latest version from IBM support.

Direct Link: efc_power

http://www.aixmind.com/wp-content/uploads/2012/06/efc_power.tar

2. Upload it to the server and untar it.

tar xvf efc_power.tar

3. Add executable permission to efc_power file.

chmod +x efc_power

4.  Run the command againt the desired fscsix as root:

./efc_power /dev/fscsi0
TX: 0eda -> 0.3802 mW, -4.20 dBm
RX: 0c68 -> 0.3176 mW, -4.98 dBm

The efc_power program to measure the transmit (TX) and RX (receive) strength. They stated it works with most Emulex fiber cards. If a server reports the TX less than -10, then the card is probably bad. If the RX is less than -10, then cabling or the SAN port is probably bad.

 

Comments Off

List WWPN of all LPARs or a specific LPAR using HMC command

Comments Off

Question:

How to WWPN of all LPARs or a specific LPAR using HMC command?

 

Solution:

 

To List WWPN of all LPARs on a managed system:

 

MS=Dev-BOX-9117-MMB-SN129SBCP
lshwres -r virtualio --rsubtype fc -m $MS --level lpar -F lpar_name,slot_num,wwpns --header |grep -v null
lpar_name,slot_num,wwpns
devaix101,5,"c05076036cfc002e,c05076036cfc002f"
devaix101,4,"c05078044abc002c,c05078044abc002d"
devaix101,3,"c05078044abc002a,c05078044abc002b"
devaix101,2,"c05078044abc0028,c05078044abc0029"
devaix102,5,"c05078044abc0538,c05078044abc0539"
devaix102,4,"c05078044abc0536,c05078044abc0537"
devaix102,3,"c05078044abc0534,c05078044abc0535"
devaix102,2,"c05078044abc0532,c05078044abc0533"
devaix103,5,"c05078044abc00c6,c05078044abc00c7"
devaix103,4,"c05078044abc00c4,c05078044abc00c5"
devaix103,3,"c05078044abc00c2,c05078044abc00c3"
devaix103,2,"c05078044abc00c0,c05078044abc00c1"

 

Please be noted slot_number is useful to identify the FC adapter on AIX.

For example:

On server devaix103

lsdev -Ccadapter|grep fcs
fcs0 Available C2-T1 Virtual Fibre Channel Client Adapter
fcs1 Available C3-T1 Virtual Fibre Channel Client Adapter
fcs2 Available C4-T1 Virtual Fibre Channel Client Adapter
fcs3 Available C5-T1 Virtual Fibre Channel Client Adapter

 

The location of fcs0 is C2, which means its slot_number is 2.

 

To List WWPN of a specific LPAR:

MS=Dev-BOX-9117-MMB-SN129SBCP
LPAR=devaix103
lshwres -r virtualio --rsubtype fc -m $MS --filter lpar_names=$LPAR --level lpar -F lpar_name,slot_num,wwpns --header

lpar_name,slot_num,wwpns

devaix103,5,”c05078044abc00c6,c05078044abc00c7″

devaix103,4,”c05078044abc00c4,c05078044abc00c5″
devaix103,3,”c05078044abc00c2,c05078044abc00c3″
devaix103,2,”c05078044abc00c0,c05078044abc00c1″

Comments Off

How to find out which HBA active path goes through on a system with HDLM?

Comments Off

Question:

How to find out which HBA active path goes through on a system with HDLM?

 

Answer:

 

Solution 1:

Use lspath to show all the paths to the disk.

 

  • lsdev -l hdisk3
hdisk3 Available 01-09-02 Hitachi Disk Array (Fibre)

 

  • lspath -l hdisk3
Enabled hdisk3 fscsi0
Enabled hdisk3 fscsi1

Solution 2:

Use dlnkmgr command to figure out the HBA location code and then use lsdev to figure out the FCS number. For example:

  • dlnkmgr view -hba
HbaID Port.Bus IO-Count   IO-Errors  Paths  OnlinePaths
00000 08.04         45031          0      4           4
00001 08.03         45999          0      4           4
  • lsdev | grep fcs
fcs0          Available 03-08    FC Adapter
fcs1          Available 04-08    FC Adapter

For this example, HbaID 00000 (08.04) corresponds to fcs1 (04-08). You can then use lscfg to get the actual hardware path.

 

I wrote a script to find out the all the active HBA and the WWNs.

for loc in $(/usr/DynamicLinkManager/bin/dlnkmgr view -path  \
|awk '/hdisk/ {print $2}'|awk -F. '{print $2"-"$1}'|sort|uniq);  \
do hba=$(lsdev -Ccadapter -S A|awk '/'$loc'/ {print $1}') ; \
wwn=$(lscfg -vl $hba | awk -F. '/Network Address/ {print $NF}'); \
echo $hba $wwn ; done

fcs0 10000000C972EBAE
fcs3 10000000C972EA4B

If your system is a VIO client and does not use HDLM, then use:
for i in $(lspath|awk '/fscsi/ {print $3}'|uniq|awk -Ffscsi '{print $NF}'); \
do wwn=$(lscfg -vl fcs$i | awk -F. '/Network Address/ {print $NF}'); echo fcs$i $wwn;done

fcs0 C05076038CFC0120
fcs1 C05076038CFC0122
fcs2 C05076038CFC0124
fcs3 C05076038CFC0126
Comments Off