Differences between revisions 3 and 4
Revision 3 as of 2018-08-27 12:55:54
Size: 2262
Editor: ?GoncaloC
Comment:
Revision 4 as of 2018-08-28 02:23:12
Size: 2261
Editor: PaulWise
Comment: typo
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
There is a new packaged in Debian 9 named DebianPkg:targetcli-fb ("free branch"). You may need to also install the package DebianPkg:dbus if the system is not a new Debian 9 install (has been upgraded from Jessie). All configuration is done through the CLI by executing targetcli. A basic configuration is created upon first use. There is a new package in Debian 9 named DebianPkg:targetcli-fb ("free branch"). You may need to also install the package DebianPkg:dbus if the system is not a new Debian 9 install (has been upgraded from Jessie). All configuration is done through the CLI by executing targetcli. A basic configuration is created upon first use.

This page explains how to use LIO, the inkernel iscsi target, and the targetcli tool to configure LIO.

Quickstart

Install the software

LIO is shipped with the linux kernel.

The targetcli tool was packaged for Debian 7 as targetcli from the original source code produced by ?RisingTide Systems, now Datera. It was discontinued in Debian 8. Functioning packages can still be created from the source code for Debian 8.

There is a new package in Debian 9 named targetcli-fb ("free branch"). You may need to also install the package dbus if the system is not a new Debian 9 install (has been upgraded from Jessie). All configuration is done through the CLI by executing targetcli. A basic configuration is created upon first use.

Basic commands

"ls" lists the existing configuration tree. "help" or "help [command] provides help on the targetcli command line commands. Configuration changes should be made by navigating the tree and using the appropriate commands to add new enties. The CLI supports autocomplete and lists available commands in each context when tab is hit.

Example workflow for adding a target:

  • 1. add a block device to be provided
    cd backstores/block
    create iscsivolume1 /dev/sdb1
    2. create a target
    cd /iscsi
    create iqn.2005-03.org.open-iscsi.servername:iscsivolumea
    3. attach the block device to the target
    cd luns
    create /backstores/block/iscsivolume1
    4. configure the acl, add an authorized wwn and configure CHAP
    cd ../..
    create iqn.2005-03.org.open-iscsi.clientname:abcdefgh1234
    set auth userid=clientid
    set auth password=123456789abc
    5. attach the listening IP addresses, in this case replace the default all interfaces with a single one
    cd ../..
    delete 0.0.0.0 3260
    create 10.0.0.1 3260
    6. check the configuration, save configuration and exit
    cd /
    saveconfig
    exit

Configuration files and updates

Usage of the CLI is similar for the targetcli and targetcli-fb versions, but the configuration files are different and incompatible. targetcli stores its configuration in a text file in /etc/target/scsi_target.lio. targetcli-fb stores its configuration in /etc/rtslib-fb-target/saveconfig.json.