Dual-mode FC configuration: Difference between revisions

From OSNEXUS Online Documentation Site
Jump to navigation Jump to search
m Rewrite to house style and fix the values (QSTOR-12529). The page told readers to write qlini_mode=enabled for dual mode - that is initiator-only - and qlini_mode=disabled for target-only, which never creates the initiator role and breaks Enable FC Initiator Mode. Replaces the hand-written modprobe edits with qs-util enabledualmode/disabledualmode, which write dual/exclusive to the file the product expects, and explains that enabling FC target mode means dual because the initiator role is wha...
 
Line 1: Line 1:
== Setting up the FC Target driver to use dual initiator + target mode ==
[[Category:QuantaStor_Guide]]
'''Enabling FC target mode on QuantaStor means dual mode''' -- initiator and target at the same time, rather than target alone. Both roles are needed: the target role presents LUNs to FC hosts, and the initiator role is what lets the appliance enumerate the FC initiators visible on the fabric. Without it the appliance is invisible to its own fabric, so target mode and dual mode go together.
 
The mode is set by the <code>qlini_mode</code> option on the QLogic driver, applies to '''the whole appliance''' rather than to an individual port, and takes effect at boot. Use the <code>qs-util</code> verbs below rather than editing the driver configuration by hand -- they write the correct values to the file the product expects.
 
{| class="wikitable"
! Mode !! <code>qlini_mode</code> !! What it gives you
|-
| '''Dual''' ''(use this for FC target)'' || <code>dual</code> || Initiator and target together. FC target ports serve LUNs, and FC remote ports on the fabric are discoverable.
|-
| Target only || <code>exclusive</code> || Target only. LUNs are served, but '''no FC initiators are discoverable''' -- see the warning below.
|}


To make this configuration change you'll need to login to the appliance via ssh then use 'sudo -i' to elevate your permissions to root level.
== Checking the current mode ==
Next, run this command to configure the QLogic driver to enable initiator mode like so:


echo "options qla2xxx_scst qlini_mode=enabled" > /etc/modprobe.d/qla2xxx_scst.conf
{{Navigation|Storage Management &rarr; Storage Systems &rarr; ''select a Storage System'' &rarr; FC Ports ''(tab)''}}


Next, stop the scsi target service and rmmod/modprobe the driver with these changes and restart the scsi target service:
The '''Mode''' column reports each port's active mode. From the appliance, read it per port from sysfs -- substitute your own <code>hostN</code>, which you can list with <code>ls /sys/class/fc_host/</code>:


service iscsi-target stop
<pre style="font-size: smaller">
rmmod qla2xxx_scst
cat /sys/class/fc_host/host7/device/scsi_host/host7/active_mode
modprobe qla2xxx_scst
</pre>
service iscsi-target start


This will have cleared out all active sessions and targets.  Next, restart the Quantastor management service to re-expose FC and iSCSI targets
Dual mode prints both roles:


service quantastor restart
<pre style="font-size: smaller">
Initiator, Target
</pre>


Now verify the new configuration to ensure that both initiator and target mode are enabled via the below commands.  Note that the hostN location of your FC port entry will likely be different than the host16 value used in this example.
To see the value the driver was actually loaded with:


cat /sys/class/fc_host/host16/device/scsi_host/host16/active_mode
<pre style="font-size: smaller">
cat /sys/module/qla2xxx_scst/parameters/qlini_mode
</pre>


If the ''active_mode'' output only reports Initiator mode, you will need to go to the web interface and use the "Enable FC Target Port" dialog available by right clicking on the FC card.  Alternatively you can temporarily enable target access via the command below, note that your FC WWN will be different than the one used in this example.
== Setting dual initiator + target mode ==


echo "1" > /sys/kernel/scst_tgt/targets/qla2x00t/21\:00\:00\:24\:ff\:2e\:d1\:16/enabled
<pre style="font-size: smaller">
sudo qs-util enabledualmode
sudo reboot
</pre>


Finally, check to make sure that the driver is now in dual Initiator+Target mode. Again, host16 is used in this example but your FC port may be at some other hostN number.
This writes <code>qlini_mode=dual</code> to <code>/etc/modprobe.d/qla2xxx.conf</code> for both the <code>qla2xxx</code> and <code>qla2xxx_scst</code> module names. '''A reboot is required''' -- the option is read when the driver loads.


cat /sys/class/fc_host/host16/device/scsi_host/host16/active_mode
After the reboot, confirm both roles are present with the <code>active_mode</code> check above.


This should print out both modes like so:
== Setting target-only mode ==


Initiator, Target
<pre style="font-size: smaller">
sudo qs-util disabledualmode
sudo reboot
</pre>


This writes <code>qlini_mode=exclusive</code>, and the ports come up in target mode without transitioning from initiator mode at boot.


== Setting up the FC Target driver to use target only mode ==
'''Target-only mode makes FC initiators invisible to the appliance.''' With <code>exclusive</code> set, <code>qs fc-remote-port-list</code> returns nothing and the '''Select Initiator...''' picker in [[Hosts and Host Groups|Add Host]] finds no WWPNs, because the appliance has no initiator role with which to see the fabric. You can still create a host by typing the initiator's WWPN in by hand. Use target-only mode only where that trade-off is intended.


Follow the sames steps noted above but change the "enabled" to "disabled" like so:
== Do not edit the driver configuration by hand ==


echo "options qla2xxx_scst qlini_mode=disabled" > /etc/modprobe.d/qla2xxx_scst.conf
Older guidance had administrators write the modprobe file directly. Two values in common circulation are wrong:


In this mode the FC driver will startup in Target mode and will not need to transition from Initiator to Target after booting.
{| class="wikitable"
! Value !! What it actually does
|-
| <code>qlini_mode=enabled</code> || '''Initiator only''' -- not dual mode.
|-
| <code>qlini_mode=disabled</code> || The initiator role is '''never created'''. A port taken out of target mode then has no role at all, which breaks '''Enable FC Initiator Mode'''.
|}


[[Category:QuantaStor_Guide]]
Hand-written instructions also commonly use the filename <code>/etc/modprobe.d/qla2xxx_scst.conf</code>, while <code>qs-util</code> writes <code>/etc/modprobe.d/qla2xxx.conf</code>. Following both leaves two files setting the same option to different values, and which one wins is not something to rely on. If you have an old <code>qla2xxx_scst.conf</code> on an appliance, remove it and set the mode with <code>qs-util</code>.
 
== Related pages ==
 
* [[Fibre Channel Target Port Management]] -- FC target ports, remote ports, LIPs and assigning volumes over FC
* [[Hosts and Host Groups]] -- host records and FC WWPN initiators
* [[QuantaStor Shell Utilities]] -- <code>qs-util</code> and the other appliance command-line tools
 
----
<small>''Verified against QuantaStor 6.9.0.''</small>

Latest revision as of 06:03, 5 September 2026

Enabling FC target mode on QuantaStor means dual mode -- initiator and target at the same time, rather than target alone. Both roles are needed: the target role presents LUNs to FC hosts, and the initiator role is what lets the appliance enumerate the FC initiators visible on the fabric. Without it the appliance is invisible to its own fabric, so target mode and dual mode go together.

The mode is set by the qlini_mode option on the QLogic driver, applies to the whole appliance rather than to an individual port, and takes effect at boot. Use the qs-util verbs below rather than editing the driver configuration by hand -- they write the correct values to the file the product expects.

Mode qlini_mode What it gives you
Dual (use this for FC target) dual Initiator and target together. FC target ports serve LUNs, and FC remote ports on the fabric are discoverable.
Target only exclusive Target only. LUNs are served, but no FC initiators are discoverable -- see the warning below.

Checking the current mode

Navigation: Storage Management → Storage Systems → select a Storage System → FC Ports (tab)

The Mode column reports each port's active mode. From the appliance, read it per port from sysfs -- substitute your own hostN, which you can list with ls /sys/class/fc_host/:

cat /sys/class/fc_host/host7/device/scsi_host/host7/active_mode

Dual mode prints both roles:

Initiator, Target

To see the value the driver was actually loaded with:

cat /sys/module/qla2xxx_scst/parameters/qlini_mode

Setting dual initiator + target mode

sudo qs-util enabledualmode
sudo reboot

This writes qlini_mode=dual to /etc/modprobe.d/qla2xxx.conf for both the qla2xxx and qla2xxx_scst module names. A reboot is required -- the option is read when the driver loads.

After the reboot, confirm both roles are present with the active_mode check above.

Setting target-only mode

sudo qs-util disabledualmode
sudo reboot

This writes qlini_mode=exclusive, and the ports come up in target mode without transitioning from initiator mode at boot.

Target-only mode makes FC initiators invisible to the appliance. With exclusive set, qs fc-remote-port-list returns nothing and the Select Initiator... picker in Add Host finds no WWPNs, because the appliance has no initiator role with which to see the fabric. You can still create a host by typing the initiator's WWPN in by hand. Use target-only mode only where that trade-off is intended.

Do not edit the driver configuration by hand

Older guidance had administrators write the modprobe file directly. Two values in common circulation are wrong:

Value What it actually does
qlini_mode=enabled Initiator only -- not dual mode.
qlini_mode=disabled The initiator role is never created. A port taken out of target mode then has no role at all, which breaks Enable FC Initiator Mode.

Hand-written instructions also commonly use the filename /etc/modprobe.d/qla2xxx_scst.conf, while qs-util writes /etc/modprobe.d/qla2xxx.conf. Following both leaves two files setting the same option to different values, and which one wins is not something to rely on. If you have an old qla2xxx_scst.conf on an appliance, remove it and set the mode with qs-util.

Related pages


Verified against QuantaStor 6.9.0.