| ISCSICTL(8) | NetBSD System Manager's Manual | ISCSICTL(8) |
| iscsictl | [-v] [-d directory] command [arguments ...] |
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:
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
| August 8, 2011 | NetBSD 5.99 |