Asymmetric Logical Unit Assignment
From Linux-iSCSI
SCSI-4 Asymmetric Logical Unit Assignment (ALUA, target_core_alua.c) is a multipathing method that allows each SCSI Target Port to manage access states and path attributes using an explict method, or implictly 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, so they have been implemented in the generic Target engine, and hence can be used for all SCSI transport fabrics, such as iSCSI, Fibre Channel (FC), FCoE, Serial Attached SCSI (SAS), etc.
Contents |
Standards compliance
The Target ALUA implementation (target_core_alua.c) conforms to SPC-4 (r17). ALUA with SPC-4 Persistent Reservations is supported on Target ports with Activate Persist across target power loss (PR APTPL) with LIO 3.1.
Supported features
- ALUA Logical Unit Groups (per Target 3.x 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
PREFERREDbit for individual Target Port Groups per storage object. -
REPORT_TARGET_PORT_GROUPSfor obtaining Target Port Group metadata from a given Target 3.x storage object.
Unsupported features
- Secondary Target Port Groups for managing the offline secondary ALUA access state.
Implementation
SPC-4 implict/explict ALUA is implemented as a SCSI feature in the Target engine (target_core_alua.c), and thus is agnostic to the fabric modules. Hence, ALUA can automatically be used for all fabric modules, such as iSCSI, FCoE, Fibre Channel, etc.
The patch sets were as follows:
- 08/19/2009 (patch): added ALUA group infrastructure.
- 08/31/2009 (patch): added metadata support for primary/secondary ALUA access states and status.
- 08/31/2009 (patch): added support for an optional ALUA transition delay for debugging client side ALUA code.
Any Host OS that is SPC-3/SPC-4 MPIO/ALUA capable should work just fine, using OPTIMIZED and NON-OPTIMIZED states.
Explicit ALUA using SET_TARGET_PORT_GROUPS can change ALUA access states according to admin or automated initiator side actions.
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
RTSadmin (from RisingTide Systems) is a comprehensive, powerful, yet easy storage management tool that can efficiently handle complex LIO Target 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
- Target
- SCSI: Persistent Reservations (PRs), Multiple Connections per Session (MC/S), Error Recovery Level (ERL)
- Fabric modules: iSCSI, FCoE, Fibre Channel and InfiniBand
- Management: RTSadmin