Fibre Channel Target Port Management

From OSNEXUS Online Documentation Site
Jump to navigation Jump to search

QuantaStor supports Fibre Channel (FC) block storage alongside iSCSI, exposing storage volumes as LUNs to FC initiator hosts. FC target mode is managed through the SCST kernel driver and requires QLogic FC HBAs — other vendors' HBAs operate in initiator mode only and cannot be switched to target mode by QuantaStor.

Overview

How FC Target Mode Works

A QLogic FC HBA in QuantaStor operates in one of two modes:

Mode Description
Target The port presents storage volumes as LUNs to connected FC initiator hosts. This is the operating mode for storage provisioning.
Initiator The port connects to remote storage targets. Used for external SAN connectivity in HA configurations. This is the default mode before enabling.

QuantaStor manages FC LUN masking through the SCST driver's sysfs interface. Access control is WWN-based (World Wide Name) — each FC initiator is identified by its port WWN (WWPN), and LUNs are explicitly mapped per initiator.

FC vs iSCSI

Feature Fibre Channel iSCSI
Infrastructure Dedicated FC fabric and switches Existing Ethernet network
Initiator ID Port WWN (WWPN) iSCSI Qualified Name (IQN)
Authentication WWN + LUN masking (ACL) IQN + optional CHAP
Speed 8/16/32 Gbps (HBA-dependent) 1/10/25/40/100 GbE
Latency Very low Low (higher than FC)
Zoning Managed on FC switch N/A (IP routing / VLANs)
QuantaStor mgmt Target ports, LUN masking Portal groups, CHAP, IQNs

Volumes can be exposed simultaneously over both FC and iSCSI — each protocol assigns independent LUN numbers to the same underlying block device.

Prerequisites

  • QLogic FC HBA installed in the QuantaStor appliance
  • SCST kernel module loaded (managed automatically by QuantaStor)
  • FC switch zoning configured so the target port WWN is visible to the desired initiator host WWPNs
  • Storage pool and volumes created before enabling FC target mode

Note: QuantaStor does not configure FC switch zoning. Zone management must be performed on the FC switch fabric using the switch vendor's tools (e.g., Brocade Zone Admin, Cisco DCNM/NDFC).

Viewing FC Target Ports

Navigation: System Management → FC Target Ports

CLI:

# List all FC target ports on the system
qs fiber-channel-port-list

# Get details for a specific port
qs fiber-channel-port-get --fc-target-port=<wwpn-or-id>

Key fields returned:

Field Description
portWwn Port World Wide Name — unique identifier for this FC port
nodeWwn Node World Wide Name — identifies the HBA
fabricWwn WWN of the FC fabric/switch this port is connected to
isTargetModeEnabled Whether this port is enabled as an FC target
status Current port status (e.g., Online)
firmwareVersion HBA firmware version
driverVersion HBA driver version
vendor / model HBA vendor and model (e.g., QLogic QLE2742)

Enabling and Disabling FC Target Mode

Enable (Switch to Target Mode)

Enabling a port puts it into FC target mode. QuantaStor registers the port with the SCST driver and begins presenting LUNs to connected initiators. The port will be automatically re-enabled in target mode on each service restart.

Navigation: System Management → FC Target Ports → (right-click port) → Enable FC Target Port

CLI:

qs fiber-channel-port-enable --fc-target-port=<wwpn-or-id>

Disable (Return to Initiator Mode)

Disabling a port removes it from SCST and returns it to initiator mode. Active FC sessions on this port will be dropped.

Navigation: System Management → FC Target Ports → (right-click port) → Disable FC Target Port

CLI:

qs fiber-channel-port-disable --fc-target-port=<wwpn-or-id>

Assigning Volumes to FC Initiator Hosts

FC LUN masking is managed at the storage volume level. Each host is identified by its initiator WWPN, and volumes are explicitly mapped to those hosts.

Register a Host

Before assigning volumes, register the initiator host and its WWPN.

Navigation: Storage Management → Hosts → (toolbar) Create Host

CLI:

qs host-create --name=esxi-host-01 --description="VMware ESXi host"

Add an FC Initiator Port to the Host

Navigation: Storage Management → Hosts → (right-click host) → Add Initiator Port → enter initiator WWPN

CLI:

qs host-initiator-add --host=esxi-host-01 --wwpn=21:00:00:24:ff:8a:1b:2c

Assign a Volume to the Host

Navigation: Storage Management → Storage Volumes → (right-click volume) → Assign to Host

CLI:

qs volume-assign --volume=vol1 --host=esxi-host-01

QuantaStor automatically selects an available LUN number and programs the SCST ACL. The LUN assignment can be static (fixed) or dynamic (automatic):

# Assign with a specific LUN number (static assignment)
qs volume-assign --volume=vol1 --host=esxi-host-01 --lun=5

Unassign a Volume

qs volume-unassign --volume=vol1 --host=esxi-host-01

Viewing Connected FC Initiators

Remote FC ports (initiators) that are visible through the fabric and connected to an FC target port are listed as remote ports.

Navigation: System Management → FC Target Ports → (expand port) → Remote Ports

CLI:

# List all visible remote FC initiator ports
qs fc-remote-port-list

# Get details for a specific remote port
qs fc-remote-port-get --fc-remote-port=<id>

Each remote port entry shows the initiator WWPN and which local target port it is visible through. If an expected initiator is not visible, verify FC switch zoning is configured correctly.

Forcing Remote Port Discovery (LIP)

The Loop Initialization Primitive (LIP) triggers fabric-wide device rediscovery. Issue a LIP if newly zoned initiator hosts are not appearing as remote ports.

Navigation: System Management → FC Target Ports → (right-click port) → Issue LIP

CLI:

qs fiber-channel-port-issuelip --fc-target-port=<wwpn-or-id>

To issue a LIP on all FC ports at once:

sudo /opt/osnexus/quantastor/bin/qs_fc_issue_lip.sh

Remote ports are also re-scanned automatically every 10 seconds by the QuantaStor fabric manager.

WWN Emulation

QuantaStor supports WWN emulation — presenting an alternate WWPN to the fabric instead of the physical HBA WWN. This is useful when migrating from another storage system where hosts already have ACLs programmed to a specific WWN.

WWN emulation is configured at the system level. Contact OSNEXUS support for setup procedures.

The physical WWN is preserved in portWwn / nodeWwn; the active emulated WWN appears in activePortWwn / activeNodeWwn.

FC Port Performance Monitoring

QuantaStor includes a background FC port monitoring daemon (qs-fcportmon) that collects per-port statistics and writes them to InfluxDB for display in Grafana dashboards.

Metrics Collected

Metric Description
fc_port_tx_iops Transmitted frames per second
fc_port_rx_iops Received frames per second
fc_port_tx_bytes Transmitted bytes per second
fc_port_rx_bytes Received bytes per second
fc_port_ping Round-trip latency to remote port (via fcping)

Manual Statistics Inspection

# Raw statistics from the kernel (hex values)
cat /sys/class/fc_host/host5/statistics/tx_frames
cat /sys/class/fc_host/host5/statistics/rx_frames
cat /sys/class/fc_host/host5/statistics/tx_words
cat /sys/class/fc_host/host5/statistics/rx_words

# Check port state
cat /sys/class/fc_host/host5/port_state

# Check fabric name the port is connected to
cat /sys/class/fc_host/host5/fabric_name

Replace host5 with the appropriate host number shown in the FC target port listing.

FC Monitoring Service

# Check service status
systemctl status qs-fcportmon

# Run a one-time metric collection (debug)
sudo /opt/osnexus/quantastor/scripts/qs_fcportmon.py --runonce --showports

Troubleshooting

FC Port Not Appearing as Target

  1. Confirm the HBA is a supported QLogic model: qs fiber-channel-port-list — non-QLogic HBAs will show but cannot be enabled as targets.
  2. Verify the SCST driver is loaded: ls /sys/kernel/scst_tgt/targets/qla2x00t/
  3. Check the QuantaStor service log for SCST errors: journalctl -u quantastor --since "10 minutes ago" | grep -i scst
  4. Confirm the port is enabled: qs fiber-channel-port-get --fc-target-port=<wwpn> — check isTargetModeEnabled.

Initiator Host Not Visible as Remote Port

  1. Confirm FC switch zoning includes both the initiator WWPN and the target WWPN in the same zone.
  2. Issue a LIP to trigger re-discovery: qs fiber-channel-port-issuelip --fc-target-port=<wwpn>
  3. Verify the physical FC link is up: cat /sys/class/fc_host/host5/port_state — should read Online.
  4. Confirm the target port is online on the switch (check switch port status for the connected SFP/cable).

Volume Not Visible to Host After Assignment

  1. Confirm the initiator WWPN registered on the host matches the actual HBA WWPN on the initiating server.
  2. On the initiator server, rescan the HBA: for Linux, run echo "- - -" > /sys/class/scsi_host/host0/scan or use rescan-scsi-bus.sh.
  3. For VMware ESXi, rescan the storage adapters from vCenter: Storage → Adapters → Rescan.
  4. Verify the LUN assignment is present: qs volume-get --volume=vol1 — check the host assignment.
  5. Check the SCST ACL entry is programmed: ls /sys/kernel/scst_tgt/targets/qla2x00t/<target_wwn>/ini_groups/

Active Sessions Blocking Port Disable

If disabling an FC port fails because active sessions exist, list and force-close them:

# List active sessions on a target port (replace WWN)
ls /sys/kernel/scst_tgt/targets/qla2x00t/21:00:00:24:ff:1a:2b:3c/sessions/

# Force-close a specific initiator session
echo "1" > /sys/kernel/scst_tgt/targets/qla2x00t/<target_wwn>/sessions/<initiator_wwn>/force_close

Poor FC Throughput

  1. Check the HBA link speed negotiated with the switch: cat /sys/class/fc_host/host5/speed — should match the HBA and SFP capability (e.g., 16 Gbit).
  2. Verify the SFP type matches the cable type (SR vs LW) and switch port configuration.
  3. Check for CRC errors on the switch port — CRC errors indicate a physical layer problem (bad cable, dirty SFP, or SFP mismatch).
  4. Review FC port metrics via the Grafana dashboard for sustained throughput baselines.

CLI Quick Reference

Command Short Form Description
fiber-channel-port-list fcp-list List all FC target ports
fiber-channel-port-get fcp-get Get details for a specific FC port
fiber-channel-port-enable fcp-enable Enable target mode on a port
fiber-channel-port-disable fcp-disable Disable target mode on a port
fiber-channel-port-issuelip fcp-issuelip Issue LIP to force remote port rediscovery
fc-remote-port-list fcrp-list List all visible remote FC initiator ports
fc-remote-port-get fcrp-get Get details for a specific remote port
host-create Register a new initiator host
host-initiator-add Add a WWPN to a host
volume-assign Assign a volume (LUN) to a host
volume-unassign Remove a volume assignment from a host

See Also