ISCSICTL(8)

ISCSICTL(8) | NetBSD System Manager's Manual | ISCSICTL(8)

# NAME

iscsictl — program to manage iSCSI instances

# SYNOPSIS

iscsictl | [-v] [-d directory] command [arguments ...]

# DESCRIPTION

The iscsictl utility manages iSCSI instances on the local computer. It talks to the iscsid(8) program to perform this management.

iSCSI is a method for transferring SCSI commands across a TCP connection. The client which issues the SCSI command is called the initiator, and the device which receives the command and takes action is called the target; this mirrors SCSI devices, although instead of being physically attached to a host, the SCSI commands and responses take place over a network. iSCSI communication is done in sessions. The iSCSI initiator logs in to a target across the network, possibly authenticating itself; this creates an iSCSI session between initiator and target. The initiator can then issue commands to and read responses from the target.

Firstly, the iSCSI initiator on the local machine must be made aware of the network location of the target. The add_send_target is used in iscsictl to do this. The targets can be listed using the list_targets command. To login from the initiator to the target, the login command is used; this creates a session between the initiator and target. The sessions can be listed by using the list_sessions command.

The iscsictl command argument is taken from one of the following options:

version
  return the version number of the iscsictl utility
add_target
add_portal
remove_target
slp_find_targets
refresh_targets
  this command causes the iSCSI initiator to refresh its view of the iSCSI targets to which it is connected. If this command completes successfully, an “OK” value is printed. For more context on the exact usage of this command, please see the example below.
list_targets
add_send_target
  this command allows the iSCSI initiator to connect to an iSCSI target. The subsequent -a target provides the address of the target. This can be provided as a numerical IP address, or as a textual FQDN. For more context on the exact usage of this command, please see the example below.
remove_send_target
list_send_targets
add_isns_server
remove_isns_server
find_isns_servers
list_isns_servers
refresh_isns
login
  To be able to communicate with the iSCSI target, the initiator must login. This command allows this login to take place. The subsequent -P session argument provides the session which should be used to perform the login. On successful completion of this command, the session which has been created will be displayed, along with the connection number. For more context on the exact usage of this command, please see the example below.
logout
add_connection
remove_connection
inquiry
read_capacity
report_luns
test_unit_ready
add_initiator
remove_initiator
list_initiators
list_sessions
  Once login to the target has taken place, a session will have been created. To list the session information, this command is used. The session number and target information for each of the targets are displayed. For more context on the exact usage of this command, please see the example below.
set_node_name

# EXAMPLES

iscsictl is intended to be used as follows:

The initiator itself can be loaded as a kernel module, and works successfully on 2.0 (the host called "burner"), running against the NetBSD target on a 5.99 host.

    burner# modload -v -s -p /usr/lkm/iscsi_post.sh /usr/lkm/iscsidrv.o
    modload: reserving 36864 bytes of memory
    Module loaded as ID 0
    burner# iscsid
    iSCSI Daemon loaded
    burner# iscsictl add_send_target -a 172.16.135.133
    Added Send Target 1
    burner# iscsictl refresh_targets
    OK
    burner# iscsictl list_targets
         1: iqn.1994-04.org.netbsd.iscsi-target:target0
    	2: 172.16.135.133:3260,1
    burner# iscsictl login -P 2
    Created Session 2, Connection 1
    burner# iscsictl list_sessions
    Session 2: Target iqn.1994-04.org.netbsd.iscsi-target:target0
    burner# newfs /dev/rsd0a
    /dev/rsd0a: 100.0MB (204800 sectors) block size 8192, fragment size 1024
    	using 4 cylinder groups of 25.00MB, 3200 blks, 6144 inodes.
    super-block backups (for fsck -b #) at:
         32,  51232, 102432, 153632,
    burner# mount /dev/sd0a /mnt
    burner# df
    Filesystem  1K-blocks     Used     Avail Capacity  Mounted on
    /dev/wd0a     4066094   186994   3675795     4%    /
    kernfs              1        1         0   100%    /kern
    /dev/sd0a       99247        1     94283     0%    /mnt
    burner# dmesg | egrep '(scsibus|sd0)'
    scsibus0 at bha2: 16 targets, 8 luns per target
    scsibus0: waiting 2 seconds for devices to settle...
    scsibus1 at iscsi0: 1 target, 16 luns per target
    sd0 at scsibus1 target 0 lun 0: <NetBSD, NetBSD iSCSI, 0> disk fixed
    sd0: fabricating a geometry
    sd0: 100 MB, 100 cyl, 64 head, 32 sec, 512 bytes/sect x 204800 sectors
    sd0: fabricating a geometry
    sd0: fabricating a geometry
    sd0: fabricating a geometry
    burner#

and, on the target end of the iSCSI session:

    Reading configuration from `/etc/iscsi/targets'
    target0:rw:0.0.0.0/0
    	extent0:/tmp/iscsi-target0:0:104857600
    DISK: 1 logical unit (204800 blocks, 512 bytes/block), type iscsi fs
    DISK: LUN 0: 100 MB disk storage for "target0"
    TARGET: iSCSI Qualified Name (IQN) is iqn.1994-04.org.netbsd.iscsi-target
    > iSCSI Discovery login  successful from iqn.1994-04.org.netbsd:iscsi.burner.cupertino.alistaircrooks.com:0 on 172.16.135.137 disk -1, ISID 70368764559360, TSIH 1
    < iSCSI Discovery logout successful from iqn.1994-04.org.netbsd:iscsi.burner.cupertino.alistaircrooks.com:0 on 172.16.135.137 disk -1, ISID 70368764559360, TSIH 1
    > iSCSI Normal login  successful from iqn.1994-04.org.netbsd:iscsi.burner.cupertino.alistaircrooks.com:0 on 172.16.135.137 disk 0, ISID 70368764559360, TSIH 2

# SEE ALSO

iscsid(8)

# HISTORY

The iscsictl utility appeared in NetBSD 6.0.

# AUTHORS

Alistair Crooks <agc@NetBSD.org> wrote this manual page. The iscsictl utility was contributed by Wasabi Systems, Inc.

August 8, 2011 | NetBSD 5.99