Asymmetric Logical Unit Assignment
The Linux SCSI Target Wiki
SCSI-4 Asymmetric Logical Unit Assignment (ALUA, target_core_alua.c) is a multipathing method that allows each LinuxIO port to manage access states and path attributes using an explict method, or implicitly using target-side configFS operations by a target administrator. Outer-nexus OS dependent multipathing (via MO_SET_TARGET_PGS
) is performed by the SCSI Initiator port that allows ALUA Access States to be set on per SCSI target port basis.
ALUA allows SCSI Initiator ports to make intelligent path decisions to optimize usage of the available bandwith.
ALUA is a SCSI protocol feature that is implemented in the LIO engine, and hence can be used for all SCSI transport fabrics, such as FCoE, Fibre Channel, iSCSI, iSER, SRP, Serial Attached SCSI (SAS), etc.
Contents |
Standards compliance
The LIO ALUA implementation (target_core_alua.c) conforms to SPC-4 (r17). ALUA with SPC-4 Persistent Reservations is supported on LIO ports with Activate Persist across target power loss (PR APTPL
).
Supported features
- ALUA Logical Unit Groups (per LIO storage object)
- ALUA Target Port Groups (per fabric module SCSI target port)
- Implict ALUA state transition via Target/configFS
- Explict ALUA state transition via
SET_TARGET_PORT_GROUPS
- All primary ALUA access states (Optimized, NonOptimized, Standby, and Unavailable)
- The secondary ALUA access state (Offline)
- The
PREFERRED
bit for individual Target Port Groups per storage object. -
REPORT_TARGET_PORT_GROUPS
for obtaining Target Port Group metadata from a given LIO storage object.
Unsupported features
- Secondary Target Port Groups (TPGs) for managing the offline secondary ALUA access state.
Test and validation
The implementation has been extensively validated against the following Initiators:
- Linux using Open-iSCSI with the generic ALUA handler (
drivers/scsi/scsi_dh_alua.c
) - OpenSolaris x86_64 using their iSCSI Initiator with ZFS LUNs and MPxIO
Setup
targetcli is a comprehensive, powerful, yet easy storage management tool that can efficiently handle complex LIO installations, including implicit ALUA.
lio-utils provides an extended set of low-level CLI operations to configure ALUA:
tcm_node.py
--addlungp=LU_GP_NAME Add ALUA Logical Unit Group --addtgptgp=HBA/DEV <TG_PT_GP_NAME>, --addaluatpg=HBA/DEV <TG_PT_GP_NAME> Add ALUA Target Port Group to Storage Object --clearaluapref=HBA/DEV <TG_PT_GP_NAME> Clear ALUA Target Port Group Preferred Bit --dellungp=LU_GP_NAME Delete ALUA Logical Unit Group --deltgptgp=HBA/DEV TG_PT_GP_NAME, --delaluatpg=HBA/DEV TG_PT_GP_NAME Delete ALUA Target Port Group from Storage Object --listlugps List ALUA Logical Unit Groups --listtgptgp=HBA/DEV <TG_PT_GP_NAME>, --listaluatpg=HBA/DEV <TG_PT_GP_NAME> List specific ALUA Target Port Group for Storage Object --listtgptgps=HBA/DEV, --listaluatpgs=HBA/DEV List all ALUA Target Port Groups for Storage Object --setaluapref=HBA/DEV <TG_PT_GP_NAME> Set ALUA Target Port Group Preferred Bit --setaluastate=HBA/DEV <TG_PT_GP_NAME> <ALUA_ACCESS_STATE> Set ALUA access state for TG_PT_GP_NAME on Storage Object. The value access states are "o" = active/optimized, "a" = active/nonoptimized, "s" = standby, "u" = unavailable --setaluatype=HBA/DEV <TG_PT_GP_NAME> <ALUA_ACCESS_TYPE> Set ALUA access type for TG_PT_GP_NAME on Storage Object. The value type states are "both" = implict/explict, "explict", "implict", or "none" --setlugp=HBA/DEV LU_GP_NAME Set ALUA Logical Unit Group
lio_node.py
--cleartgptoff=TARGET_IQN TPGT LUN, --clearaluaoff=TARGET_IQN TPGT LUN Clear ALUA Target Port Secondary State OFFLINE --settgptgp=TARGET_IQN TPGT LUN TG_PT_GP_NAME, --setaluatpg=TARGET_IQN TPGT LUN TG_PT_GP_NAME Set ALUA Target Port Group for LIO-Target Port/LUN --settgptoff=TARGET_IQN TPGT LUN, --setaluaoff=TARGET_IQN TPGT LUN Set ALUA Target Port Secondary State OFFLINE --showtgptgp=TARGET_IQN TPGT LUN Show ALUA Target Port Group for LIO-Target Port/LUN
ConfigFS object tree
# ALUA Logical Unit Group(s), which contain associations to storage objects # in /sys/kernel/config/target/core/$HBA/$DEV/ target# tree /sys/kernel/config/target/core/alua/ /sys/kernel/config/target/core/alua/ `-- lu_gps `-- default_lu_gp |-- lu_gp_id `-- members `-- lio_lu_gp |-- lu_gp_id `-- members # For ALUA Target Port Groups, which contain associations to fabric module # SCSI Target Port/LUNs for each individual storage object target# tree /sys/kernel/config/target/core/iblock_0/lvm_test0/alua /sys/kernel/config/target/core/iblock_0/lvm_test0/alua |-- default_tg_pt_gp | |-- alua_access_state | |-- alua_access_status | |-- alua_access_type | |-- members | |-- nonop_delay_msecs | |-- preferred | `-- tg_pt_gp_id |-- lio_alua_east | |-- alua_access_state | |-- alua_access_status | |-- alua_access_type | |-- members | |-- nonop_delay_msecs | |-- preferred | `-- tg_pt_gp_id `-- lio_alua_west |-- alua_access_state |-- alua_access_status |-- alua_access_type |-- members |-- nonop_delay_msecs |-- preferred `-- tg_pt_gp_id
This running configuration provides an example for implict and explict ALUA operation.
See also
- targetcli
- LinuxIO
- Fabric modules: FCoE, Fibre Channel, iSCSI, iSER, SRP and vHost
- SCSI: Persistent Reservations (PRs), Multiple Connections per Session (MC/S), Error Recovery Level (ERL), vStorage APIs for Array Integration (VAAI)