System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

Hi All,

I have four HBA cards are connected with two servers, but only two of them are connected with fabric swith (that only two have the link) , two servers are having different OS (RHEL 4 and RHEL 5).

As i am working from offshore , i am not able to view physically that which two ports are having connected , so i would like to know from OS , is it possible?
4 REPLIES
senthil_kumar_1
Super Advisor

Re: How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

Each server is having four HBA cards
Matti_Kurkela
Honored Contributor
Solution

Re: How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

RHEL 5:

The the directory /sys/class/fc_host will have one sub-directory named like "hostN" for each FC port.

In each sub-directory, there are multiple files. These contain human-readable text: you can view them with the "cat" command. The most useful ones for identifying the HBA cards and checking their connection states would be:

node_name = the WWNN of the HBA port.

port_name = the WWPN of the HBA port.

port_state = whether the port has a link or not.

device = a symbolic link to the PCI bus device hierarchy in the /sys tree: use "ls -ld device" to see the PCI bus ID of the HBA port.

The /proc/scsi/qla2xxx/* or /proc/scsi/lpfc/* files that existed in older RHEL versions are not there in RHEL 5 any more.


RHEL 4:

In RHEL 4, the FibreChannel HBA information was in the middle of a transition to the /sys presentation format, and Emulex and Qlogic drivers present their information differently.

Like RHEL 5, RHEL 4 has a /sys/class/fc_host directory, but the hostN sub-directories contain very little information.

RHEl 4, Emulex HBAs:

The directory /sys/class/scsi_host has sub-directories named like hostN for each SCSI-like bus adapter, including but not limited to FC HBAs.

The sub-directories of Emulex lpfc cards are identifiable by the fact that they have multiple files named lpfc_* in addition to the standard contents.

The most interesting files:

disc_map = WWNs of the mapped disks

fwrev = HBA firmware revision

node_name = WWNN of the HBA

port_name = WWPN of the HBA

state = link state

The /proc/scsi/lpfc/* files exist, but only have the same information as the /sys/class/scsi_host/host*/disc_map files. The firmware and HBA WWN information that used to be in the /proc/scsi/lpfc/* files in RHEL 3 has been moved to /sys.


RHEL 4, Qlogic HBAs:

In RHEL 4, Qlogic HBA driver still uses the pre-RHEL4 style /proc format: each HBA has a file in /proc/scsi/qla2xxx directory. That file contains the HBA state information, WWNs and firmware version numbers.

The /sys/class/fc_host/hostN and /sys/class/scsi_host/hostN sub-directories exist, but won't have much FC-specific information.

MK
MK
senthil_kumar_1
Super Advisor

Re: How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

Hi Matti,

RHEL5.3:

I have checked as you said in /sys/class/fc_host.

# cd /sys/class/fc_host

# cd host1

# more port_state
Online

# cd ../host2

# more port_state
Online

# cd ../host3

# more port_state
Online

# cd ../host4

# more port_state
Online


So as per above output, four HBA ports are having connectivity , but I have given the connectivity only for two ports.

So /sys/class/fc_host is not showing the correct link state.


Then I checked in /sys/class/scsi_host

# cd /sys/class/scsi_host

# cd host1

# more state
Link Up - F_Port

# cd ../host2

# more state
Link Up - F_Port

# cd ../host3

# more state
Link Down

# cd ../host4

# more state
Link Down


So as per above output , The link states are shown correct.


RHEL 4:

As you said , There is no information about link state in "/sys/class/scsi_host/hostX"


Then I have checked in /proc/scsi/qlaxxxx.

# cd /proc/scsi/qlaxxxx

# more 1

SCSI Device Information:
scsi-qla1-adapter-node=500110a0001a5387;
scsi-qla1-adapter-port=500110a0001a5386;
scsi-qla1-target-0=50060e8005472f00;


# more 2

SCSI Device Information:
scsi-qla1-adapter-node=500110a0001a5388;
scsi-qla1-adapter-port=500110a0001a5387;
scsi-qla1-target-0=50060e8005472f01;

# more 3

SCSI Device Information:
scsi-qla1-adapter-node=500110a0001a5389;
scsi-qla1-adapter-port=500110a0001a5388;


# more 4

SCSI Device Information:
scsi-qla1-adapter-node=500110a0001a5390;
scsi-qla1-adapter-port=500110a0001a5389;


So as per above output, the last two HBA ports are not having the entry like "scsi-qla1-target" , so i believe those two are not having the connectivity.


I am going to use above methods to find HBA link state in RHEL5 and RHEL4.

Can i use these methods?

Are above methods are correct?
Matti_Kurkela
Honored Contributor

Re: How to view HBA card are connected with fabric switch in RHEL 4 and RHEL 5

Your methods seem correct to me.

Interesting that /sys/class/fc_host/host*/port_state did not show the correct state.

(Our RHEL 5.x systems were at a remote location with all HBA connections in use, so I could not just go and disconnect a cable to test - sorry!)

MK
MK