The lio-utils.git tree for the generic Target_Core_Mod/ConfigFS engine and LIO-Target/ConfigFS fabric module v3.x for lio-core-2.6.git is now available!
The current stable branch is lio-3.1, work has begun on lio-3.2 on lio-utils.git HEAD
Contents |
lio-utils.git is the userspace source tree for target_core_mod generic core v3.x + TCM/ConfigFS v2.0 and LIO-Target v3.x fabric module that provides iSCSI Target functionality on a number of Linux baremetal and virtualized systems. Running the v3.x requires a newer Linux kernel (currently v2.6.3x or v2.6.29) for the kernel modules (located in lio-core-2.6.git). Please see LIO-Target for instructions and checking out and building the Linux kernel source and LIO modules from lio-core-2.6.git and howto for v3.x CLI userspace usage.
So far this code has been tested with v2.6.31 x86 HVM, x86_64 KVM and PPC64, but now that the v3.x Linux-iSCSI target is controlled completely through ConfigFS, this allows for much better cleaner method for controlling at kernel level target engine and fabric module subsystem. Both in terms of binary complied C code through say a traditional IOCTL, and in terms of 'real-time' control configuration for a target mode storage engine.
The source can be access via gitweb at: lio-utils.git
You can checkout your own git tree with:
git clone git://git.kernel.org/pub/scm/linux/storage/lio/lio-utils.git lio-utils.git
The current development version at HEAD is v3.1, also the v3.0 branch can be accessed with:
git checkout origin/lio-3.0
Doing a 'make install' will setup tcm_node.py and lio_node.py CLI for creating, modifying and viewing the running configuration of target_core_mod v3.0 infrastructure and the iscsi_target_mod LIO-Target) v3.0 fabric module.
The 'make install' will use 'python setup.py install' for lio-utils.git/tcm-py and lio-utils.git/lio-py into /usr/lib/$PYTHON_VER/site-packages (also /usr/lib64 as well).
Once tcm_node, tcm_dump, lio_node, and lio_dump have been installed, have a look at LIO-Target v3.0 howto
The tcm_dump.py and lio_dump.py scripts are for printing the running configfs layout of both modules to STDOUT.
The location of the configuration file for target_core_mod (a configfs script at /etc/target/tcm_start.sh) and LIO-Target (iSCSI configfs script) at /etc/target/lio_start.sh. These are called by /etc/init.d/target start during normal operation.
Calling /etc/init.d/target stop will call lio_node --unload and tcm_node --unload to walk the ConfigFS trees and shutdown the running configure and unload the modules.
/etc/init.d/target status will give you output from tcm_node --listhbas and lio_node --listendpoints.
These are the python 'optparsed' arguements for the different v3.x CLI ops for controlling Target_Core_Mod/ConfigFS in target_core_mod. All of the functionality for complete SPC-4 ALUA and Persistent_Reservations support has been added to the TCM CLI.
Also note that Target_Core_Mod/ConfigFS can be accessed directly from /sys/kernel/config/target/core
usage: tcm_node [options]
options:
-h, --help show this help message and exit
--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
--addtgptgpwithmd=HBA/DEV <TG_PT_GP_NAME> <TG_PT_GP_ID>, --addaluatpgwithmd=HBA/DEV <TG_PT_GP_NAME> <TG_PT_GP_ID>
Add ALUA Target Port Group to Storage Object with ID
and process ALUA metadata
--block=HBA/DEV <UDEV_PATH>, --iblock=HBA/DEV <UDEV_PATH>
Associate TCM/IBLOCK object with Linux/BLOCK device
--clearaluapref=HBA/DEV <TG_PT_GP_NAME>
Clear ALUA Target Port Group Preferred Bit
--delhba=HBA Delete TCM Host Bus Adapter (HBA)
--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
--createdev=HBA/DEV <SUBSYSTEM_PARAMS>
Create TCM Storage Object using subsystem dependent
parameters, and generate new T10 Unit Serial for
IBLOCK,FILEIO,RAMDISK
--establishdev=HBA/DEV <SUBSYSTEM_PARAMS>
Create TCM Storage Object using subsystem dependent
parameters, do not generate new T10 Unit Serial
--fileio=HBA/DEV <FILE> <SIZE_IN_BYTES>
Associate TCM/FILEIO object with Linux/VFS file or
underlying device for buffered FILEIO
--freedev=HBA/DEV Free TCM Storage Object
--listdevattr=HBA/DEV
List TCM storage object device attributes
--listhbas List TCM Host Bus Adapters (HBAs)
--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
--lvsnapattrset=HBA/DEV ATTR=VALUE
Set LV snapshot configfs attributes for TCM/IBLOCK
storage object
--lvsnapattrshow=HBA/DEV
Show LV snapshot configfs attributes for TCM/IBLOCK
storage object
--lvsnapinit=HBA/DEV MAX_SNAPSHOTS SNAP_SIZE_STR SNAP_INTERVAL_STR
Initialize snapshot with default attributes
--lvsnapstart=HBA/DEV
Enable snapshot daemon for TCM/IBLOCK LVM storage
object
--lvsnapstat=HBA/DEV Display LV snapshot status for TCM/IBLOCK LVM storage
object
--lvsnapstop=HBA/DEV Disable snapshot daemon for TCM/IBLOCK LVM storage
object
--pr=HBA/DEV Show Persistent Reservation info
--praptpl=HBA/DEV Process PR APTPL metadata from file
--prshowmd=HBA/DEV Show APTPL metadata file
--ramdisk=HBA/DEV <PAGES>
Create and associate TCM/RAMDISK object
--scsi=HBA/DEV <C:T:L>, --pscsi=HBA/DEV <C:T:L>
Associate TCM/pSCSI object with Linux/SCSI device by
bus location
--scsibyudev=DEV <UDEV_PATH>, --pscsibyudev=DEV <UDEV_PATH>
Associate TCM/pSCSI object with Linux/SCSI device by
UDEV Path
--setaluadelay=HBA/DEV <TG_PT_GP_NAME> <NON_OP_DELAY_IN_MSECS>
Set ALUA Target Port Group delay for
Active/NonOptimized in milliseconds
--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
--setaluatransdelay=HBA/DEV <TG_PT_GP_NAME> <TRANS_DELAY_IN_MSECS>
Set ALUA Target Port Group Transition delay
--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"
--setdevattr=HBA/DEV <ATTRIB> <VALUE>
Set new value for TCM storage object device attribute
--setlugp=HBA/DEV LU_GP_NAME
Set ALUA Logical Unit Group
--setudevpath=HBA/DEV <UDEV_PATH>
Set UDEV Path Information, only used when --createdev
did not contain <udev_path> as parameter
--setunitserial=HBA/DEV <UNIT_SERIAL>
Set T10 EVPD Unit Serial Information
--setunitserialwithmd=HBA/DEV <UNIT_SERIAL>
Set T10 EVPD Unit Serial Information and process PR
APTPL metadata
--udevpath=HBA/DEV Show UDEV Path Information for TCM storage object
--unload Unload target_core_mod
--version Display target_core_mod version information
--wwn=HBA/DEV Show WWN info
These are the python 'optparsed' arguements for the different v3.x CLI ops for controlling LIO-Target/ConfigFS in the iscsi_target_mod fabric module.
LIO-Target/ConfigFS can be accessed directly from /sys/kernel/config/target/iscsi
usage: lio_node [options]
options:
-h, --help show this help message and exit
--addlunacl=TARGET_IQN TPGT INITIATOR_IQN TPG_LUN MAPPED_LUN
Add iSCSI Initiator LUN ACL to LIO-Target Portal Group
LUN
--addnodeacl=TARGET_IQN TPGT INITIATOR_IQN
Add iSCSI Initiator ACL to LIO-Target Portal Group
--addnp=TARGET_IQN TPGT IP:PORT
Add LIO-Target IPv6 or IPv4 network portal
--addlun=TARGET_IQN TPGT LUN PORT_ALIAS TCM_HBA/DEV
Create LIO-Target Logical Unit
--addtpg=TARGET_IQN TPGT
Create LIO-Target portal group
--aluasecmd=TARGET_IQN TPGT LUN
Process ALUA secondary metadata for Port/LUN
--cleartgptoff=TARGET_IQN TPGT LUN, --clearaluaoff=TARGET_IQN TPGT LUN
Clear ALUA Target Port Secondary State OFFLINE
--dellunacl=TARGET_IQN TPGT INITIATOR_IQN MAPPED_LUN
Delete iSCSI Initiator LUN ACL from LIO-Target Portal
Group LUN
--delnodeacl=TARGET_IQN TPGT INITIATOR_IQN
Delete iSCSI Initiator ACL from LIO-Target Portal
Group
--delnp=TARGET_IQN TPGT IP:PORT
Delete LIO-Target IPv6 or IPv4 network portal
--deliqn=TARGET_IQN Delete LIO-Target IQN Endpoint
--dellun=TARGET_IQN TPGT LUN
Delete LIO-Target Logical Unit
--deltpg=TARGET_IQN TPGT
Delete LIO-Target Portal Group
--demomode=TARGET_IQN TPGT, --permissive=TARGET_IQN TPGT
Disable all iSCSI Initiator ACL requirements (enable
DemoMode) for LIO-Target Portal Group (Disabled by
default)
--disableauth=TARGET_IQN TPGT
Disable iSCSI Authentication for LIO-Target Portal
Group (Enabled by default)
--disablelunwp=TARGET_IQN TPGT INITIATOR_IQN MAPPED_LUN
Clear Write Protect bit for iSCSI Initiator LUN ACL
--disabletpg=TARGET_IQN TPGT
Disable LIO-Target Portal Group
--enableaclmode=TARGET_IQN TPGT
Enable iSCSI Initiator ACL requirement mode for LIO-
Target Portal Group (Enabled by default)
--enableauth=TARGET_IQN TPGT
Enable iSCSI Authentication for LIO-Target Portal
Group (Enabled by default)
--enablelunwp=TARGET_IQN TPGT INITIATOR_IQN MAPPED_LUN
Set Write Protect bit for iSCSI Initiator LUN ACL
--enabletpg=TARGET_IQN TPGT
Enable LIO-Target Portal Group
--listendpoints List iSCSI Target Endpoints
--listlunacls=TARGET_IQN TPGT
List iSCSI Initiator LUN ACLs for LIO-Target Portal
Group
--listnodeacls=TARGET_IQN TPGT
List iSCSI Initiator ACLs for LIO-Target Portal Group
--listnodeattr=TARGET_IQN TPGT INITIATOR_IQN
List iSCSI Initiator ACL attributes for LIO-Target
Portal Group
--listnodeparam=TARGET_IQN TPGT INITIATOR_IQN
List iSCSI Initiator ACL RFC-3720 parameters for LIO-
Target Portal Group
--listnps=TARGET_IQN TPGT
List LIO-Target Portal Group Network Portals
--listtargetnames List iSCSI Target Names
--listtpgattr=TARGET_IQN TPGT
List LIO-Target Portal Group attributes
--listtpgparam=TARGET_IQN TPGT
List LIO-Target Portal Group RFC-3720 parameters
--setchapauth=TARGET_IQN TPGT INITIATOR_IQN USER PASS
Set CHAP authentication information for iSCSI
Initiator Node ACL
--setchapmutualauth=TARGET_IQN TPGT INITIATOR_IQN USER_IN PASS_IN
Set CHAP mutual authentication information for iSCSI
Initiator Node ACL
--setchapdiscenforce=ENFORCE=1, NOENFORCEMENT=0
Set CHAP authentication enforcement for iSCSI
Discovery Sessions
--setchapdiscauth=USER PASS
Set CHAP authentication information for iSCSI
Discovery Authentication
--setchapdiscmutualauth=USER PASS
Set CHAP mutual authentication information for iSCSI
Discovery Authentication
--setnodeattr=TARGET_IQN TPGT INITIATOR_IQN <ATTRIBUTE> <VALUE>
Set iSCSI Initiator ACL Attribute
--setnodetcq=TARGET_IQN TPGT INITIATOR_IQN DEPTH
Set iSCSI Initiator ACL TCQ Depth for LIO-Target
Portal Group
--settpgattr=TARGET_IQN TPGT <ATTRIB> <VALUE>
Set LIO-Target Port Group Attribute
--settpgparam=TARGET_IQN TPGT <PARAMETER> <VALUE>
Set LIO-Target Port Group RFC-3720 parameter
--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
--showchapauth=TARGET_IQN TPGT INITIATOR_IQN
Show CHAP authentication information for iSCSI
Initiator Node ACL
--showchapdiscauth Show CHAP authentication information for iSCSI
Discovery portal
--shownodetcq=TARGET_IQN TPGT INITIATOR_IQN
Show iSCSI Initiator ACL TCQ Depth for LIO-Target
Portal Group
--showtgptgp=TARGET_IQN TPGT LUN
Show ALUA Target Port Group for LIO-Target Port/LUN
--unload Unload LIO-Target
--version Display LIO-Target version information