环境
- Red Hat Enterprise Linux (RHEL) 7
- Red Hat Enterprise Linux (RHEL) 6
- Red Hat Enterprise Linux (RHEL) 5
问题
- What is an rport and how do I gather more information about it?
决议
- "rport" is the short form for remote port. On your host the remote port(s) would ideally be the ports that the fiber connection is connected to on the other end. For example, if a system is connected to a storage array with two controllers (i.e., nothing but the ports), then the remote port information and state can be checked. There are a few ways for checking this:
1. The information related to rhost ports is at the location:
Raw
/sys/class/fc_remote_ports/rport-*
where information like the node_name, port_name, port_status, scsi_target_id, etc. can be checked with the cat
command. For example, the following command will check the state of the port and if it is online or not:
Raw
$ cat /sys/class/fc_remote_ports/rport-1:0-0/port_state
which will show "Online", if the port is online and working normally. A simple grep
command can be used to see all port states at once:
Raw
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport*/port_state
2. Another very good utility is the systool
command from the sysfsutils package (see: man systool). With this command the information from the remote ports can be gathered in one pass by running the command with following options:
Raw
$ systool -c fc_remote_ports -v
where -c indicates class, and -v is for verbose.
- Not all "rports" are storage ports. Examine the "roles" parameter under rport to determine if the remote port is a storage target.
Raw
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport-*/roles
/sys/class/fc_remote_ports/rport-6:0-0/roles:FCP Target << storage target
/sys/class/fc_remote_ports/rport-6:0-3/roles:FCP Target << storage target
/sys/class/fc_remote_ports/rport-6:0-4/roles:FCP Initiator << HBA
/sys/class/fc_remote_ports/rport-8:0-8/roles:Fabric Port << fabric port
/sys/class/fc_remote_ports/rport-8:0-9/roles:Directory Server << fabric directory server
Remote ports associated with storage ports with also have a positive (not -1) value assigned to its scsi_target_id value.
Raw
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport-*/scsi_target_id
/sys/class/fc_remote_ports/rport-6:0-0/scsi_target_id:0
/sys/class/fc_remote_ports/rport-6:0-3/scsi_target_id:1
/sys/class/fc_remote_ports/rport-6:0-4/scsi_target_id:-1
/sys/class/fc_remote_ports/rport-8:0-8/scsi_target_id:-1
/sys/class/fc_remote_ports/rport-8:0-9/scsi_target_id:-1