LIO (SCSI target)#Architecture

{{Short description|Open-source version of SCSI target}}

{{For|information on the maintainer of LIO|Datera}}{{Multiple issues|{{COI|date=March 2013}}

{{Third-party|date=January 2014}}

{{Promotional tone|date=October 2024}}

}}

{{Infobox software

| name = LIO Target

| logo =

| screenshot = 300px

| caption = LIO Linux SCSI Target

| collapsible =

| author = Nicholas Bellinger
Jerome Martin

| developer = Datera, Inc.

| released = {{start date|2011|1|14}}

| discontinued =

| programming language = C, Python

| operating system = Linux

| platform =

| size =

| genre = Block storage

| license = GNU General Public License

| website = {{webarchive |url=https://web.archive.org/web/20221006024049/http://linux-iscsi.org/wiki/Main_Page |date=2022-10-06 |title=linux-iscsi.org}}

| repo = {{URL|github.com/open-iscsi}}

}}

The Linux-IO Target (LIO) is an open-source Small Computer System Interface (SCSI) target implementation included with the Linux kernel.{{cite web |url=http://linux-iscsi.org/wiki/LIO |title=LIO |website=Linux-IO, the Linux SCSI Target wiki |date=2016-03-12 |archive-url=https://web.archive.org/web/20220820224206/http://linux-iscsi.org/wiki/LIO |archive-date=2022-08-20 |url-status=dead}}{{better source|date=January 2014}}

Unlike initiators, which begin sessions, LIO functions as a target, presenting one or more Logical Unit Numbers (LUNs) to a SCSI initiator, receiving SCSI commands, and managing the input/output data transfers.{{Citation needed|date=October 2024}}

LIO supports a wide range of storage protocols and transport fabrics, including but not limited to Fibre Channel over Ethernet (FCoE), Fibre Channel, IEEE 1394 and iSCSI.{{Citation needed|date=October 2024}}

It is utilized in several Linux distributions and is a popular choice for cloud environments due to its integration with tools like QEMU/KVM, libvirt, and OpenStack.{{Citation needed|date=October 2024}}

The LIO project is maintained by Datera, Inc.,{{Dubious|date=October 2024|reason=Datera was accquired by VMWare}} a Silicon Valley-based storage solutions provider. On January 15, 2011, LIO was merged into the Linux kernel mainline with version 2.6.38, which was officially released on March 14, 2011.{{cite web |author=Linus Torvalds |date=2011-01-14 |title=Trivial merge |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=38567333a6dabd0f2b4150e9fb6dd8e3ba2985e5 |access-date=2019-09-28 |publisher=Kernel.org}}{{cite web |author=Thorsten Leemhuis |date=2011-03-02 |title=Kernel Log: Coming in 2.6.38 (Part 4) - Storage |url=http://www.h-online.com/open/features/Kernel-Log-Coming-in-2-6-38-Part-4-Storage-1199926.html |publisher=Heise Online}} Subsequent versions of the Linux kernel have introduced additional fabric modules to expand its compatibility.{{Citation needed|date=October 2024}}

LIO competes with other SCSI target modules in the Linux ecosystem. The SCSI Target Framework (SCST){{cite web |title=A tale of two SCSI targets |url=https://lwn.net/Articles/424004/ |archive-url=https://web.archive.org/web/20140202215812/https://lwn.net/Articles/424004/ |archive-date=2014-02-02 |access-date=2014-01-20 |publisher=Lwn.net}} is a prominent alternative for general SCSI target functionality, while for iSCSI-specific targets, the older iSCSI Enterprise Target (IET) and SCSI Target Framework (STGT) also have industry adoption.{{cite web |last=Haas |first=Florian |date=May 2012 |title=Replicate Everything! Highly Available iSCSI Storage with DRBD and Pacemaker |url=http://porky.linuxjournal.com:8080/LJ/217/11275.html |url-status=dead |archive-url=https://archive.today/20140120093312/http://porky.linuxjournal.com:8080/LJ/217/11275.html |archive-date=2014-01-20 |access-date=2019-09-28 |publisher=Linux Journal}}{{cite web |last=Bolkhovitin |first=Vladislav |date=2018-04-11 |title=SCST vs STGT |url=http://scst.sourceforge.net/scstvsstgt.html |access-date=2019-04-01 |work=Generic SCSI Target Subsystem for Linux}}

Background

The SCSI standard provides an extensible semantic abstraction for computer data storage devices, and is used with data storage systems. The SCSI T10 standards{{cite web| url=http://www.t10.org/| title=SCSI Storage Interfaces| author=Technical Committee T10| publisher=t10.org| access-date=2012-12-24}} define the commands{{cite book |url=http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf |title=SCSI Commands Reference Manual |date=April 2010 |publisher=Seagate Technology |series=100293068, Rev. C |location=Scotts Valley |access-date=2012-12-25 |archive-url=https://web.archive.org/web/20120731060035/http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf |archive-date=2012-07-31}} and protocols of the SCSI command processor (sent in SCSI CDBs), and the electrical and optical interfaces for various implementations.

A SCSI initiator is an endpoint that initiates a SCSI session. A SCSI target is the endpoint that waits for initiator commands and executes the required I/O data transfers. The SCSI target usually exports one or more LUNs for initiators to operate on.

The LIO Linux SCSI Target implements a generic SCSI target that provides remote access to most data storage device types over all prevalent storage fabrics and protocols. LIO neither directly accesses data nor does it directly communicate with applications.

Architecture

File:LIO-Architecture.png

LIO implements a modular and extensible architecture around a parallelised SCSI command processing engine.{{cite conference |first=Nicholas |last=Bellinger |title=Current Status and Future of iSCSI on the Linux platform

|conference=Linux Plumbers Conference |year=2009 |url=http://linuxplumbersconf.org/2009/slides/Nicholas-A.-Bellinger-LIO-LPC-2009.pdf}}

The LIO SCSI target engine is independent of specific fabric modules or backstore types. Thus, LIO supports mixing and matching any number of fabrics and backstores at the same time. The LIO SCSI target engine implements a comprehensive SPC-3/SPC-4{{cite web| url=http://www.t10.org/members/w_spc4.htm| title=SCSI Primary Commands - 4 (SPC-4)| author=Ralph Weber| publisher=t10.org| date=2011-01-17| access-date=2011-03-07}} feature set with support for high-end features, including SCSI-3/SCSI-4 Persistent Reservations (PRs), SCSI-4 Asymmetric Logical Unit Assignment (ALUA), VMware vSphere APIs for Array Integration (VAAI),{{cite web |url=http://linux-iscsi.org/wiki/VStorage_APIs_for_Array_Integration |title=vStorage APIs for Array Integration |website=Linux-IO, the Linux SCSI Target wiki |date=2015-08-07 |archive-url=https://web.archive.org/web/20220820224208/http://linux-iscsi.org/wiki/VStorage_APIs_for_Array_Integration |archive-date=2022-08-20 |url-status=dead}} T10 DIF, etc.

LIO is configurable via a configfs-based{{cite web| url=https://lwn.net/Articles/148973/| title=Configfs - an introduction| author=Jonathan Corbet| publisher=lwn.net| date=2005-08-24| access-date=2011-03-07}} kernel API, and can be managed via a command-line interface and API (targetcli).

=SCSI target=

The concept of a SCSI target isn't restricted to physical devices on a SCSI bus, but instead provides a generalised model for all receivers on a logical SCSI fabric. This includes SCSI sessions across interconnects with no physical SCSI bus at all. Conceptually, the SCSI target provides a generic block storage service or server in this scenario.

=Back-stores=

Back-stores provide the SCSI target with generalised access to data storage devices by importing them via corresponding device drivers. Back-stores do not need to be physical SCSI devices.

The most important back-store media types are:

  • Block: The block driver allows using raw Linux block devices as back-stores for export via LIO. This includes physical devices, such as HDDs, SSDs, CDs/DVDs, RAM disks, etc., and logical devices, such as software or hardware RAID volumes or LVM volumes.
  • File: The file driver allows using files that can reside in any Linux file system or clustered file system as back-stores for export via LIO.
  • Raw: The raw driver allows using unstructured memory as back-stores for export via LIO.

As a result, LIO provides a generalised model to export block storage.

=Fabric modules=

Fabric modules implement the front-end of the SCSI target by encapsulating and abstracting the properties of the various supported interconnect. The following fabric modules are available.

==FCoE==

File:Storage FCoE.png

The Fibre Channel over Ethernet (FCoE) fabric module allows the transport of Fibre Channel protocol (FCP) traffic across lossless Ethernet networks. The specification, supported by a large number of network and storage vendors, is part of the Technical Committee T11 FC-BB-5 standard.{{cite web |title=Fibre Channel: Backbone - 5 revision 2.00 |url=http://www.t11.org/ftp/t11/pub/fc/bb-5/09-056v5.pdf |date=June 4, 2009 |publisher=American National Standard for Information Technology International Committee for Information Technology Standards Technical Group T11 |access-date=2011-05-05}}

LIO supports all standard Ethernet NICs.

The FCoE fabric module was contributed by Cisco and Intel, and released with Linux 3.0 on July 21, 2011.{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3699d92a4d7b649bde67dff3cc681400992e0254| title=[SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support| author=Linus Torvalds| date=2011-04-18| publisher=Kernel.org | access-date=2019-09-28}}

==Fibre Channel==

Fibre Channel is a high-speed network technology primarily used for storage networking. It is standardized in the Technical Committee T11{{cite web| url=http://www.t11.org/index.html| title=T11 Home Page| access-date=2012-12-25| publisher=t11.org}} of the InterNational Committee for Information Technology Standards (INCITS).

The QLogic Fibre Channel fabric module supports 4- and 8-gigabit speeds with the following HBAs:

  • QLogic 2400 Series (QLx246x), 4GFC
  • QLogic 2500 Series (QLE256x), 8GFC (fully qual'd)

The Fibre Channel fabric module{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75f8c1f693eefacc17a65614eb4ed1ee0f84fda6| title=[SCSI] tcm_qla2xxx: Add >= 24xx series fabric module for target-core| author=Linus Torvalds| date=2012-05-15| publisher=Kernel.org|access-date=2019-09-28}} and low-level driver{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d70c103fd2a066f904712b14239a5ce141f8236| title=[SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series| author=Linus Torvalds| date=2012-05-15| publisher=Kernel.org|access-date=2019-09-28}} (LLD) were released with Linux 3.5 on July 21, 2012.{{cite web| url=http://www.h-online.com/open/features/Kernel-Log-Coming-in-3-5-Part-2-Filesystems-and-storage-1630816.html| title=Kernel Log: Coming in 3.5 (Part 2) - Filesystems and storage| author=Thorsten Leemhuis| publisher=Heise Online| date=2012-07-03| access-date=2013-01-14}}

With Linux 3.9, the following QLogic HBAs and CNAs are also supported:

  • QLogic 2600 Series (QLE266x), 16GFC, SR-IOV
  • QLogic 8300 Series (QLE834x), 16GFS/10 GbE, PCIe Gen3 SR-IOV
  • QLogic 8100 Series (QLE81xx), 8GFC/10 GbE, PCIe Gen2

This makes LIO the first open source target to support 16-gigabit Fibre Channel.

==IEEE 1394==

File:LIO-Firewire-Target.png]]

The FireWire SBP-2 fabric module enables Linux to export local storage devices via IEEE 1394, so that other systems can mount them as an ordinary IEEE 1394 storage device.

IEEE 1394 is a serial-bus interface standard for high-speed communications and isochronous real-time data transfer. It was developed by Apple as "FireWire" in the late 1980s and early 1990s, and Macintosh computers have supported "FireWire target disk mode" since 1999.{{cite web| url=http://support.apple.com/kb/HT1661| title=How to use and troubleshoot FireWire target disk mode| access-date=2012-12-24| publisher=apple.com}}

The FireWire SBP-2 fabric module was released with Linux 3.5 on July 21, 2012.{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a511ce3397803558a3591e55423f3ae6aa28c9db| title=sbp-target: Initial merge of firewire/ieee-1394 target mode support| author=Linus Torvalds| date=2012-04-15| publisher=Kernel.org|access-date=2019-09-28}}

==iSCSI==

The Internet Small Computer System Interface (iSCSI) fabric module allows the transport of SCSI traffic across standard IP networks.

By carrying SCSI sessions across IP networks, iSCSI is used to facilitate data transfers over intranets and manage storage over long distances. iSCSI can be used to transmit data over local area networks (LANs), wide area networks (WANs), or the Internet, and can enable location-independent and location-transparent data storage and retrieval.

The LIO iSCSI fabric module also implements a number of advanced iSCSI features that increase performance and resiliency, such as Multiple Connections per Session (MC/S) and Error Recovery Levels 0-2 (ERL=0,1,2).

LIO supports all standard Ethernet NICs.

The iSCSI fabric module was released with Linux 3.1 on October 24, 2011.{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91d41fdf31f74e6e2e5f3cb018eca4200e36e202| title=iSCSI merge| author=Linus Torvalds| date=2011-07-27| publisher=Kernel.org|access-date=2019-09-28}}

{{anchor|InfiniBand}}

==iSER==

Networks supporting remote direct memory access (RDMA) can use the iSCSI Extensions for RDMA (iSER) fabric module to transport iSCSI traffic. iSER permits data to be transferred directly into and out of remote SCSI computer memory buffers without intermediate data copies (direct data placement or DDP) by using RDMA.{{IETF RFC|5041}} RDMA is supported on InfiniBand networks, on Ethernet with data center bridging (DCB) networks via RDMA over Converged Ethernet (RoCE), and on standard Ethernet networks with iWARP enhanced TCP offload engine controllers.

The iSER fabric module was developed together by Datera and Mellanox Technologies, and first released with Linux 3.10 on June 30, 2013.{{cite web| url=https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6da6dc2380c3cfe8d6b59d7c3c55fdd7a521fe6c| title=Merge branch 'for-next-merge'| author=Linus Torvalds| date=2013-04-30| publisher=Kernel.org|access-date=2019-09-28}}

==SRP==

The SCSI RDMA Protocol (SRP) fabric module allows the transport of SCSI traffic across RDMA (see above) networks. As of 2013, SRP was more widely used than iSER, although it is more limited, as SCSI is only a peer-to-peer protocol, whereas iSCSI is fully routable. The SRP fabric module supports the following Mellanox host channel adapters (HCAs):

  • Mellanox ConnectX-2 VPI PCIe Gen2 HCAs (x8 lanes), single/dual-port QDR 40 Gbit/s
  • Mellanox ConnectX-3 VPI PCIe Gen3 HCAs (x8 lanes), single/dual-port FDR 56 Gbit/s
  • Mellanox ConnectX-IB PCIe Gen3 HCAs (x16 lanes), single/dual-port FDR 56 Gbit/s

The SRP fabric module was released with Linux 3.3 on March 18, 2012.{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f59e842fc0871cd5baa213dc32e0ce8e5aaf4758| title=InfiniBand/SRP merge| author=Linus Torvalds| date=2012-01-18| publisher=Kernel.org|access-date=2019-09-28}}

In 2012, c't magazine measured almost 5000 MB/s throughput with LIO SRP Target over one Mellanox ConnectX-3 port in 56 Gbit/s FDR mode on a Sandy Bridge PCI Express 3.0 system with four Fusion-IO ioDrive PCI Express flash memory cards.

==USB==

The USB Gadget fabric module enables Linux to export local storage devices via the Universal Serial Bus (USB), so that other systems can mount them as an ordinary storage device.

USB was designed in the mid-1990s to standardize the connection of computer peripherals, and has also become common for data storage devices.

The USB Gadget fabric module was released with Linux 3.5 on July 21, 2012.{{cite web| url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ba01a87e37d3ca9efe141e2907c2ec3f89490b4f| title=Merge branch 'usb-target-merge'| publisher=Kernel.org|access-date=2019-09-28}}

=Targetcli=

targetcli is a user space single-node management command line interface (CLI) for LIO.{{cite web| url=http://linux-iscsi.org/wiki/Targetcli| title=Targetcli| website=Linux-IO, the Linux SCSI Target wiki| date=2012-12-09| access-date=2012-12-25| archive-date=2013-03-02| archive-url=https://web.archive.org/web/20130302100743/http://linux-iscsi.org/wiki/Targetcli| url-status=dead}} It supports all fabric modules and is based on a modular, extensible architecture, with plug-in modules for additional fabric modules or functionality.

targetcli provides a CLI that uses an underlying generic target library through a well-defined API. Thus the CLI can easily be replaced or complemented by a UI with other metaphors, such as a GUI.

targetcli is implemented in Python and consists of three main modules:

  • the underlying rtslib and API.{{cite web |url=https://github.com/Datera/targetcli.git |title=Package rtslib| author=Jerome Martin| date=2011-08-03| access-date=2012-12-25| publisher=daterainc.com}}
  • the configshell, which encapsulates the fabric-specific attributes in corresponding 'spec' files.
  • the targetcli shell itself.

Detailed instructions on how to set up LIO targets can be found on the LIO wiki.

Linux distributions

targetcli and LIO are included in most Linux distributions per default. Here is an overview of the most popular ones, together with the initial inclusion dates:

class="wikitable sortable"
style="background:#a0c0f0;"

! Distribution

! Version{{efn|The distribution release where LIO was included first.}}

! Release

! Archive

! Installation

! Source git

! Documentation

Alpine Linux

| 2.5

| 2011-11-07

| [http://nl.alpinelinux.org/alpine/v2.5/main/x86/ Alpine Linux mirror]

| apk add targetcli-fb

| [https://github.com/agrover/targetcli-fb targetcli-fb.git]

| [http://wiki.alpinelinux.org/wiki/Linux_iSCSI_Target_%28TCM%29 How-to]

CentOS

| 6.2

| 2011-12-20

| [https://web.archive.org/web/20120615002032/http://mirror.centos.org/centos/6.2/os/x86_64/Packages/ CentOS mirror]

| su -c 'yum install fcoe-target-utils'

| [https://github.com/agrover/targetcli-fb targetcli-fb.git]

| [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.2_Technical_Notes/kernel_tp.html Tech Notes]

Debian

| 7.0 ("[http://packages.debian.org/wheezy/targetcli wheezy]")

| 2013-05-04

| [http://ftp.debian.org/debian/pool/main/ Debian pool]

| su -c 'apt-get install targetcli'

| [https://github.com/Datera/targetcli.git targetcli.git]

| {{webarchive |url=https://web.archive.org/web/20220820224207/http://linux-iscsi.org/wiki/Debian |date=2022-08-20 |title=Debian - LIO Wiki}}

Fedora

| [http://rpm.pbone.net/index.php3/stat/4/idpl/17799714/dir/fedora_16/com/targetcli-2.0rc1.fb6-1.fc16.noarch.rpm.html 16]

| 2011-11-08

| [https://web.archive.org/web/20130621172841/https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/Packages/ Fedora Rawhide]

| su -c 'yum install targetcli'

| [https://github.com/agrover/targetcli-fb targetcli-fb.git]

| [https://fedoraproject.org/wiki/Features/KernelTarget Target Wiki]

openSUSE

| 12.1

| 2011-11-08

| style="text-align:center;" colspan="4"| Requires manual installation from Datera [https://github.com/Datera/targetcli.git targetcli.git] repos.

RHEL{{efn|RHEL 6 included LIO, but it was the default only for FCoE targets, while STGT was used for iSCSI. In RHEL 7 beta, LIO is the default for FCoE, iSCSI, and for Mellanox InfiniBand iSER/SRP.{{cite web|url=https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/7.0_Release_Notes/chap-storage.html |title=Chapter 6. Storage |publisher=Access.redhat.com |access-date=2014-01-20}}}}

| 6.2

| 2011-11-16

| [https://web.archive.org/web/20130621172841/https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/Packages/ Fedora Rawhide]

| su -c 'yum install fcoe-target-utils'

| [https://github.com/agrover/targetcli-fb targetcli-fb.git]

| [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.2_Technical_Notes/kernel_tp.html Tech Notes]

Scientific Linux

| [https://web.archive.org/web/20130103072930/http://www.scientificlinux.org/distributions/6x/62 6.2]

| 2012-02-16

| [https://archive.today/20130107122234/http://mirror.mcs.anl.gov/pub/scientific-linux/6.2/x86_64/os/Packages/ SL Mirror]

| su -c 'yum install fcoe-target-utils'

| [https://github.com/agrover/targetcli-fb targetcli-fb.git]

| [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.2_Technical_Notes/kernel_tp.html Tech Notes]

SLES

| 11 SP3 MR

| 2013-12

| -

| su -c 'zypper in targetcli'

| [https://github.com/Datera/targetcli.git targetcli.git]

| {{webarchive |url=https://web.archive.org/web/20220802214717/http://linux-iscsi.org/wiki/SLES |date=2022-08-02 |title=SLES - LIO Wiki}}

Ubuntu

| [http://packages.ubuntu.com/source/precise/targetcli 12.04 LTS (precise)]

| 2012-04-26

| [http://archive.ubuntu.com/ubuntu/pool/universe/ Ubuntu universe]

| sudo apt-get install targetcli

| [https://github.com/Datera/targetcli.git targetcli.git]

| {{webarchive |url=https://web.archive.org/web/20221021042242/http://linux-iscsi.org/wiki/Ubuntu |date=2022-10-21 |title=Ubuntu - LIO Wiki}}

See also

{{Div col|colwidth=25em}}

{{div col end}}

Notes

{{Notelist}}

References

{{Clear}}

{{Reflist|30em}}