| ISCSICTL(8) | System Manager's Manual | ISCSICTL(8) | 
iscsictl —
| iscsictl | [ -dsockdir]
      command [arguments ...] | 
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.
add_target and
  add_send_target commands may include a target name,
  target address (IP or FQDN), TCP port, and group tag. Either the target
  address or target name is required. (For add_send_target, a target address is
  required). The address, port, and group tag may optionally be repeated.
add_portal
  command may include an address (IP or FQDN), port, and group tag, plus portal
  options.
-a
    target-address-p
    port-num-g
    group-tag-h-d-l
    segment-lengthCommandsiscsictl command argument is taken from one of the
  following options:
versioniscsictl
      utility and the iscsid(8)
      daemon.add_target
    target-address-spec
    [target-opts] [auth-opts]
    [-N symbolic-name]add_portal
    portal-address-spec [-I
    -target-id] [-N
    -symbolic-name]remove_target
    -I target-idremove_target
    -n target-nameslp_find_targetsrefresh_targets
    [-I target-id]list_targetsadd_send_target
    -a target-address
    [target-address-spec]
    [target-opts] [auth-opts]
    [-N symbolic-name]-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
    -I target-idremove_send_target
    -n target-namelist_send_targetsadd_isns_server
    iSNS-address-specremove_isns_server
    -I isns-server-idremove_isns_server
    -a isns-server-addressfind_isns_serverslist_isns_serversrefresh_isns
    [-I id]login
    [-m] [target-opts]
    [auth-opts] [-P
    portal-id]-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
    [-I session-id]add_connection
    [-m] [target-opts]
    [auth-opts] [-P
    portal-id]remove_connection
    -I session-id
    -C connection-idinquiry
    [-l lun]
    [-d detail]
    [-p pag]read_capacity
    [-I session-id
    [-l lun]]report_luns
    [-I session-id]test_unit_ready
    [-I session-id]add_initiator
    -a interface-address
    [-N symbolic-name]remove_initiator
    -I portal-idlist_initiatorslist_sessions
    [-c]-c flag is used, connection
      information is displayed as well. For more context on the exact usage of
      this command, please see the example below.set_node_name
    -n initiator-name
    [-A -alias]
    [-i isid]iscsictl is intended to be used as follows:
The initiator itself can be loaded as a kernel module, and works successfully on 5.0 (the host called "burner"), running against the NetBSD target on a 5.99 host.
burner# modload iscsi
burner# modstat iscsi
NAME             CLASS      SOURCE     REFS  ADDRESS          SIZE     REQUIRES
iscsi            driver     filesys    0     ffffffff813c6000 44208    -
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
iscsictl utility appeared in NetBSD
  6.0.
iscsictl utility was contributed
  by Wasabi Systems, Inc.
| August 30, 2015 | NetBSD 10.0 |