LIO

The Linux SCSI Target Wiki

(Difference between revisions)
Jump to: navigation, search
(Add link to lio-utils for target_core_mod/ConfigFS)
Line 9: Line 9:
For more information about Target_Core_Mod/ConfigFS with LIO-Target v3.0, please see [[LIO-Target/ConfigFS]]
For more information about Target_Core_Mod/ConfigFS with LIO-Target v3.0, please see [[LIO-Target/ConfigFS]]
 +
 +
Also, have a look at the TCM section of the Howto at: [[Howto#Start_target_core_mod]]
To see the TCM v3.x CLI operations using tcm_node.py and tcm_dump.py from [[lio-utils]], have a look at [[Lio-utils#v3.1_TCM_CLI_operations]]
To see the TCM v3.x CLI operations using tcm_node.py and tcm_dump.py from [[lio-utils]], have a look at [[Lio-utils#v3.1_TCM_CLI_operations]]

Revision as of 01:21, 12 September 2009

The ConfigFS enabled Generic Target Engine v3.0 (lio-core-2.6.git/drivers/target/target_core_mod) supports the SCSI-3 for virtual storage devices from IBLOCK, FILEIO, and RAMDISK subsystem plugins. Some of the most notable functionality includes Persistent_Reservations and ALUA which have been implemented following SPC-4.

SCSI-3 and greater revisions are supported using the PSCSI subsystem plugin for Linux/SCSI passthrough, but only from control CDBs capable by the device firmware. Making Linux/SCSI block_devices take advantage of the Persistent Reservations and ALUA functionality is a WIP.

From there, ConfigFS enabled SCSI fabric modules (like LIO-Target/ConfigFS v3.0) use symbolic links using link(2)/unlink(2) for creating/removing SCSI Target Ports below /sys/kernel/config/target/$FABRIC.

For more information about Target_Core_Mod/ConfigFS with LIO-Target v3.0, please see LIO-Target/ConfigFS

Also, have a look at the TCM section of the Howto at: Howto#Start_target_core_mod

To see the TCM v3.x CLI operations using tcm_node.py and tcm_dump.py from lio-utils, have a look at Lio-utils#v3.1_TCM_CLI_operations

Startup script for Target_Core_Mod/ConfigFS

       modprobe target_core_mod
       export CONFIGFS=/sys/kernel/config/
       export TARGET=/sys/kernel/config/target/core/
       export FABRIC=/sys/kernel/config/target/iscsi/
       # START IBLOCK SUBSYSTEM PLUGIN EXPORT
       mkdir -p $TARGET/iblock_0/lvm_test0
       # This enabled NAA WWN 0x83 VPN descriptors
       echo a97e4ce21c0711de829b000c2943d57b > $TARGET/iblock_0/lvm_test0/wwn/vpd_unit_serial
       # Major/minor method for referencing struct block_device..
#      echo iblock_major=254,iblock_minor=2 > $TARGET/iblock_0/lvm_test0/control
#      echo 1 > $TARGET/iblock_0/lvm_test0/enable
       # OR, locate struct block_device from passed file descriptor..
       exec 3<>/dev/lio-test/test0
       echo 3 > $TARGET/iblock_0/lvm_test0/fd
       exec 3>&-
       # Enable 4096 sector size emulation
       echo 4096 > $TARGET/iblock_0/lvm_test0/attrib/block_size
       # More tunables for target_core_mod
#      echo 0 > $TARGET/iblock_0/lvm_test0/attrib/emulate_tas
       echo 0 > $TARGET/iblock_0/lvm_test0/attrib/emulate_ua_intlck_ctrl
       # END IBLOCK SUBSYSTEM PLUGIN EXPORT
       # START PSCSI SUBSYSTEM PLUGIN EXPORT
       mkdir -p $TARGET/pscsi_0/sdd
       # This is only limited to t10 vendor type WWN naming..
       echo 66e418b4-e9ab-11dd-8f51-000c2943d57b > $TARGET/pscsi_0/sdd/wwn/vpd_unit_serial
       # Linux/SCSI HCTL method of locating struct scsi_device
#      echo scsi_channel_id=0,scsi_target_id=3,scsi_lun_id=0 > $TARGET/pscsi_0/sdd/control
#      echo 1 > $TARGET/pscsi_0/sdd/enable
       # or, locate struct scsi_device from file descriptor (only for TYPE_DISK+TYPE_ROM)
       exec 3<>/dev/sdd
       echo 3 > $TARGET/pscsi_0/sdd/fd
       exec 3>&-
       # END PSCSI SUBSYSTEM PLUGIN EXPORT
       # START RAMDISK SUBSYSTEM PLUGIN OBJECTS
       mkdir -p $TARGET/rd_mcp_0/ramdisk
       echo rd_pages=32768 > $TARGET/rd_mcp_0/ramdisk/control
       echo 1 > $TARGET/rd_mcp_0/ramdisk/enable
       # END RAMDISK SUBSYSTEM PLUGIN OBJECTS
       # START FILEIO SUBSYSTEM PLUGIN OBJECTS
       mkdir -p $TARGET/fileio_0/fileio
       # Note that using a backing struct block_device for fd_dev_name will automatically locate fd_dev_size,
       # otherwise this value is in bytes..
       echo "fd_dev_name=/dev/sde,fd_dev_size=134217728" > $TARGET/fileio_0/fileio/control
       echo 1 > $TARGET/fileio_0/fileio/enable
       # END FILEIO SUBSYSTEM PLUGIN OBJECTS

tree $CONFIGFS output for Target_Core_Mod/ConfigFS

  /sys/kernel/config/target/core/
  |-- alua
  |   |-- lu_gps
  |   |   `-- default_lu_gp
  |   |       |-- alua_access_state
  |   |       |-- lu_gp_id
  |   |       `-- members
  |   `-- tg_pt_gps
  |       `-- default_tg_pt_gp
  |           |-- alua_access_state
  |           |-- members
  |           `-- tg_pt_gp_id
  |-- fileio_0
  |   |-- fileio
  |   |   |-- alua_lu_gp
  |   |   |-- attrib
  |   |   |   |-- block_size
  |   |   |   |-- emulate_tas
  |   |   |   |-- emulate_ua_intlck_ctrl
  |   |   |   |-- hw_block_size
  |   |   |   |-- hw_max_sectors
  |   |   |   |-- hw_queue_depth
  |   |   |   |-- max_sectors
  |   |   |   |-- queue_depth
  |   |   |   `-- task_timeout
  |   |   |-- control
  |   |   |-- enable
  |   |   |-- fd
  |   |   |-- info
  |   |   |-- pr
  |   |   |   |-- res_holder
  |   |   |   |-- res_pr_all_tgt_pts
  |   |   |   |-- res_pr_generation
  |   |   |   |-- res_pr_holder_tg_port
  |   |   |   |-- res_pr_registered_i_pts
  |   |   |   |-- res_pr_type
  |   |   |   `-- res_type
  |   |   `-- wwn
  |   |       |-- vpd_assoc_logical_unit
  |   |       |-- vpd_assoc_scsi_target_device
  |   |       |-- vpd_assoc_target_port
  |   |       |-- vpd_protocol_identifier
  |   |       `-- vpd_unit_serial
  |   `-- hba_info
  |-- iblock_0
  |   |-- hba_info
  |   `-- lvm_test0
  |       |-- alua_lu_gp
  |       |-- attrib
  |       |   |-- block_size
  |       |   |-- emulate_tas
  |       |   |-- emulate_ua_intlck_ctrl
  |       |   |-- hw_block_size
  |       |   |-- hw_max_sectors
  |       |   |-- hw_queue_depth
  |       |   |-- max_sectors
  |       |   |-- queue_depth
  |       |   `-- task_timeout
  |       |-- control
  |       |-- enable
  |       |-- fd
  |       |-- info
  |       |-- pr
  |       |   |-- res_holder
  |       |   |-- res_pr_all_tgt_pts
  |       |   |-- res_pr_generation
  |       |   |-- res_pr_holder_tg_port
  |       |   |-- res_pr_registered_i_pts
  |       |   |-- res_pr_type
  |       |   `-- res_type
  |       `-- wwn
  |           |-- vpd_assoc_logical_unit
  |           |-- vpd_assoc_scsi_target_device
  |           |-- vpd_assoc_target_port
  |           |-- vpd_protocol_identifier
  |           `-- vpd_unit_serial
  |-- pscsi_0
  |   |-- hba_info
  |   `-- sdd
  |       |-- alua_lu_gp
  |       |-- attrib
  |       |   |-- block_size
  |       |   |-- emulate_tas
  |       |   |-- emulate_ua_intlck_ctrl
  |       |   |-- hw_block_size
  |       |   |-- hw_max_sectors
  |       |   |-- hw_queue_depth
  |       |   |-- max_sectors
  |       |   |-- queue_depth
  |       |   `-- task_timeout
  |       |-- control
  |       |-- enable
  |       |-- fd
  |       |-- info
  |       |-- pr
  |       |   |-- res_holder
  |       |   |-- res_pr_all_tgt_pts
  |       |   |-- res_pr_generation
  |       |   |-- res_pr_holder_tg_port
  |       |   |-- res_pr_registered_i_pts
  |       |   |-- res_pr_type
  |       |   `-- res_type
  |       `-- wwn
  |           |-- vpd_assoc_logical_unit
  |           |-- vpd_assoc_scsi_target_device
  |           |-- vpd_assoc_target_port
  |           |-- vpd_protocol_identifier
  |           `-- vpd_unit_serial
  `-- rd_mcp_0
      |-- hba_info
      `-- ramdisk
          |-- alua_lu_gp
          |-- attrib
          |   |-- block_size
          |   |-- emulate_tas
          |   |-- emulate_ua_intlck_ctrl
          |   |-- hw_block_size
          |   |-- hw_max_sectors
          |   |-- hw_queue_depth
          |   |-- max_sectors
          |   |-- queue_depth
          |   `-- task_timeout
          |-- control
          |-- enable
          |-- fd
          |-- info
          |-- pr
          |   |-- res_holder
          |   |-- res_pr_all_tgt_pts
          |   |-- res_pr_generation
          |   |-- res_pr_holder_tg_port
          |   |-- res_pr_registered_i_pts
          |   |-- res_pr_type
          |   `-- res_type
          `-- wwn
              |-- vpd_assoc_logical_unit
              |-- vpd_assoc_scsi_target_device
              |-- vpd_assoc_target_port
              |-- vpd_protocol_identifier
              `-- vpd_unit_serial
   25 directories, 114 files

kernel ring buffer output of Target_Core_Mod/ConfigFS

  TARGET_CORE[0]: Loading Generic Kernel Storage Engine: v3.0.0 on Linux/i686 on 2.6.29
  TARGET_CORE[0]: Initialized ConfigFS Fabric Infrastructure: v1.0.0 on Linux/i686 on 2.6.29
  SE_PC[0] - Registered Plugin Class: TRANSPORT
  PLUGIN_TRANSPORT[1] - pscsi registered
  PLUGIN_TRANSPORT[4] - iblock registered
  PLUGIN_TRANSPORT[5] - rd_dr registered
  PLUGIN_TRANSPORT[6] - rd_mcp registered
  PLUGIN_TRANSPORT[7] - fileio registered
  SE_PC[1] - Registered Plugin Class: OBJ
  PLUGIN_OBJ[1] - dev registered
  Target_Core_ConfigFS: Located se_plugin: def1d890 plugin_name: iblock hba_type: 4 plugin_dep_id: 0
  CORE_HBA[0] - Linux-iSCSI.org iBlock HBA Driver 3.0 on Generic Target Core Stack v3.0
  CORE_HBA[0] - Attached iBlock HBA: 0 to Generic Target Core TCQ Depth: 512
  CORE_HBA[0] - Attached HBA to Generic Target Core
  IBLOCK: Allocated ib_dev for lvm_test0
  Target_Core_ConfigFS: Allocated se_subsystem_dev_t: def1e800 se_dev_su_ptr: df3e8400
  Target_Core_ConfigFS: Set emulated VPD Unit Serial: a97e4ce21c0711de829b000c2943d57b
  IBLOCK: Claiming struct block_device: df64f740
  bio: create slab <bio-1> at 1
  IBLOCK: Created bio_set() for major/minor: 254:2
  iblock: Using SPC3_PERSISTENT_RESERVATIONS emulation
  iblock: Enabling ALUA Emulation for SPC-3 device
  iblock: Adding to default ALUA LU Group: core/alua/lu_gps/default_lu_gp
  CORE_iBLOCK[0] - Activating Device with TCQ: 0 at Major: 254 Minor 2
     Vendor: LIO-ORG   Model: IBLOCK            Revision: 3.0 
     Type:   Direct-Access                      ANSI SCSI revision: 05
  T10 VPD Unit Serial Number: a97e4ce21c0711de829b000c2943d57b
  T10 VPD Page Length: 72
  T10 VPD Identifer Length: 16
  T10 VPD Identifier Association: addressed logical unit
  T10 VPD Identifier Type: NAA
  T10 VPD Binary Device Identifier: 36001405a97e4ce21c0711de829b000c2
  T10 VPD Identifer Length: 48
  T10 VPD Identifier Association: addressed logical unit
  T10 VPD Identifier Type: T10 Vendor ID based
  T10 VPD ASCII Device Identifier: LIO-ORG
  Target_Core_ConfigFS: Registered iblock se_dev->se_dev_ptr: d4354000 from fd
  dev[d4354000]: SE Device block_size changed to 4096
  dev[d4354000]: SE Device UA_INTRLCK_CTRL flag: 0
  Target_Core_ConfigFS: Located se_plugin: def1d824 plugin_name: pscsi hba_type: 1 plugin_dep_id: 0
  CORE_HBA[1] - Linux-iSCSI.org SCSI HBA Driver v3.0 on Generic Target Core Stack v3.0
  CORE_HBA[1] - MPT SPI Host
  CORE_HBA[1] - Attached SCSI HBA to Generic Target Core with TCQ Depth: 127 MaxSectors: 8192
  CORE_HBA[1] - Attached HBA to Generic Target Core
  PSCSI: Allocated pdv: d4384e60 for sdd
  Target_Core_ConfigFS: Allocated se_subsystem_dev_t: def1e000 se_dev_su_ptr: d4384e60
  Target_Core_ConfigFS: Set emulated VPD Unit Serial: 66e418b4-e9ab-11dd-8f51-000c2943d57b
  PSCSI: Claiming def68800 Major:Minor - 8:48
  pscsi: Using SPC_PASSTHROUGH, no reservation emulation
  pscsi: Using SPC_ALUA_PASSTHROUGH, no ALUA emulation
  CORE_PSCSI[0] - Activating Device with TCQ: 32 at SCSI Location (Channel/Target/LUN) 0/3/0
    Vendor: VMware,   Model: VMware Virtual S  Revision: 1.0 
    Type:   Direct-Access                      ANSI SCSI revision: 02
  PSCSI Status Byte exception at task: ded5c000 CDB: 0x12 Result: 0x08000002
  CORE_PSCSI[0] - Added TYPE_DISK for 0:3:0
  Target_Core_ConfigFS: Registered pscsi se_dev->se_dev_ptr: d4354400 from fd
  Target_Core_ConfigFS: Located se_plugin: def1d8d8 plugin_name: rd_mcp hba_type: 6 plugin_dep_id: 0
  CORE_HBA[2] - Linux-iSCSI.org Ramdisk HBA Driver v3.0 on Generic Target Core Stack v3.0
  CORE_HBA[2] - Attached Ramdisk HBA: 0 to Generic Target Core TCQ Depth: 256 MaxSectors: 1024
  CORE_HBA[2] - Attached HBA to Generic Target Core
  Target_Core_ConfigFS: Allocated se_subsystem_dev_t: def1c000 se_dev_su_ptr: d3541500
  RAMDISK: Referencing Page Count: 32768
  CORE_RD[0] - Built Ramdisk Device ID: 0 space of 32768 pages in 11 tables
  rd_mcp: Using SPC3_PERSISTENT_RESERVATIONS emulation
  rd_mcp: Enabling ALUA Emulation for SPC-3 device
  rd_mcp: Adding to default ALUA LU Group: core/alua/lu_gps/default_lu_gp
  CORE_RD[0] - Activating Device with TCQ: 0 at Ramdisk Device ID: 0
    Vendor: LIO-ORG   Model: RAMDISK-MCP       Revision: 3.0 
    Type:   Direct-Access                      ANSI SCSI revision: 05
  T10 VPD Unit Serial Number: 1234567890:2_0
  T10 VPD Page Length: 39
  T10 VPD Identifer Length: 35
  T10 VPD Identifier Association: addressed logical unit
  T10 VPD Identifier Type: T10 Vendor ID based
  T10 VPD ASCII Device Identifier: LIO-ORG
  CORE_RD[0] - Added LIO MEMCPY Ramdisk Device ID: 0 of 32768 pages in 11 tables, 134217728 total bytes
  Target_Core_ConfigFS: Registered se_dev->se_dev_ptr: d4355800
  Target_Core_ConfigFS: Located se_plugin: def1d8fc plugin_name: fileio hba_type: 7 plugin_dep_id: 0
  CORE_HBA[3] - Linux-iSCSI.org FILEIO HBA Driver 3.0 on Generic Target Core Stack v3.0
  CORE_HBA[3] - Attached FILEIO HBA: 0 to Generic Target Core with TCQ Depth: 256 MaxSectors: 1024
  CORE_HBA[3] - Attached HBA to Generic Target Core
  FILEIO: Allocated fd_dev for d436f448
  Target_Core_ConfigFS: Allocated se_subsystem_dev_t: de984000 se_dev_su_ptr: d4385400
  FILEIO: Referencing Path: /dev/sde
  FILEIO: Referencing Size: 134217728 bytes
  FILEIO: Claiming d4385400 Major:Minor - 8:64
  FILEIO: Using size: 428867072 bytes from struct block_device blocks: 837631 hardsect_size: 512
  fileio: Using SPC3_PERSISTENT_RESERVATIONS emulation
  fileio: Enabling ALUA Emulation for SPC-3 device
  fileio: Adding to default ALUA LU Group: core/alua/lu_gps/default_lu_gp
  CORE_FILE[0] - Activating Device with TCQ: 0 at FILEIO Device ID: 0
    Vendor: LIO-ORG   Model: FILEIO            Revision: 3.0 
    Type:   Direct-Access                      ANSI SCSI revision: 05
  T10 VPD Unit Serial Number: 1234567890:3_0
  T10 VPD Page Length: 34
  T10 VPD Identifer Length: 30
  T10 VPD Identifier Association: addressed logical unit
  T10 VPD Identifier Type: T10 Vendor ID based
  T10 VPD ASCII Device Identifier: LIO-ORG
  CORE_FILE[0] - Added LIO FILEIO Device ID: 0 at /dev/sde, 428867072 total bytes
  Target_Core_ConfigFS: Registered se_dev->se_dev_ptr: d4355c00
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense