Lio-utils

The Linux SCSI Target Wiki

(Difference between revisions)
Jump to: navigation, search
(v3.1 TCM CLI operations)
m (v3.1 TCM CLI operations)
Line 64: Line 64:
These are the python 'optparsed' arguements for the different v3.x CLI ops.  All of the functionality
These are the python 'optparsed' arguements for the different v3.x CLI ops.  All of the functionality
-
for complete SPC-4 [[Persistent_Reservation]] and [[ALUA]] support has been added to the TCM CLI.
+
for complete SPC-4 [[ALUA]] and [[Persistent_Reservations]] support has been added to the TCM CLI.
usage: tcm_node [options]
usage: tcm_node [options]

Revision as of 00:10, 12 September 2009

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 development version is lio-3.1, and the stable branch is lio-3.0.

Contents

Introduction

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.30 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.30 x86 HVM, x86_64 KVM and PPC64, but now that the v3.0 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.

Source

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

Distributions tested with lio-utils.git code

Installation

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).

Usage

Once tcm_node, tcm_dump, lio_node, and lio_dump have been installed, have a look at LIO-Target v3.0 howto

Configuration Files

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.

v3.1 TCM CLI operations

These are the python 'optparsed' arguements for the different v3.x CLI ops. All of the functionality for complete SPC-4 ALUA and Persistent_Reservations support has been added to the TCM CLI.

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

Target_Core_Mod/ConfigFS can be accessed directly from /sys/kernel/config/target/core

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense