Most command sequences require root or super user permission.
Configuration
with iscsiutil
To add an iSCSI discovery
target IP address or a target portal group tag to the kernel
registry, use:
# iscsiutil [/dev/iscsi] -a -I <ip-address> [-P <tcp-port>][-M <portal-grp-tag>]
The
iSCSI target will be probed during ioscan processing using the static scanning technique described in “Device
Discovery”.
<ip-address> The ip_address specified can be an IPv4 formatted address
or a DNS host name. The bracketed [ ] parameters are optional.
<tcp-port> A TCP port may be specified for the iSCSI target. If
no port is specified, the default iSCSI port (3260) will be used.
<portal-grp-tag> The target portal group tag may be specified (a value
from 0 to 65535 inclusive); otherwise, a default value of 1 will
be used.
To Delete an iSCSI discovery target IP address from the kernel
registry, use:
# iscsiutil [/dev/iscsi] -d -I <ip-address> [-P <tcp-port>][-M <portal-grp-tag>]
<ip-address> The ip_address specified can be an IPv4 formatted address
or a DNS name
<tcp-port> A TCP port may be specified for the iSCSI target. If
no port is specified, the default iSCSI target port (3260) will
be used.
<portal-grp-tag> The target portal group tag may be specified (a value
from 0 to 65535 inclusive); otherwise a default value of 1 will
be used.
To add an initiator name and optionally add an initiator alias,
use:
# iscsiutil [/dev/iscsi] -i -N <initiator-name> [-A <initiator-alias>]
|
(names must be in “iqn” or “eui” format)
See “Configuring
the iSCSI Software Initiator”, for
more information on iqn and eui naming formats.
Management
with iscsiutil
To display statistics from the iSCSI Software
Initiator, use:
# iscsiutil [/dev/iscsi] -s [-G] [-S [<ssn_inst> [-C [<cid>]]]]
-G displays the global statistics.
-S displays the session
statistics for all sessions; if an initiator session identifier
instance (ssn_inst) is specified, then statistics will be displayed
for that session only.
-C displays statistics for
all connections of the specified session instance (ssn_inst); if a connection identifier (cid) is specified, then statistics will be displayed
for that connection.
To display the iSCSI name and alias for the iSCSI initiator
node, as well as the current authentication method and login key
information, use:
# iscsiutil [/dev/iscsi] -l
To display the transport driver name
and version, use:
# iscsiutil [/dev/iscsi]
To display information about current sessions, targets, and
connections, use:
# iscsiutil [/dev/iscsi] -p [-O | -D | [-T <target-name>]]
or
# iscsiutil [/dev/iscsi] -p [-S [<ssn_inst> [-C [<cid>]] [-V]]]
-D displays all current
discovery target information.
-O displays all current
operational targets and related information.
-T displays information for the iSCSI
target-name specified.
-S displays the session
information for all sessions; if an initiator session identifier
instance (ssn_inst) is specified, then information will be displayed
for that session only.
Session
information displayed includes:
- The
session instance number.
- The
target IP address and port.
- The
target portal group tag.
-C displays statistics for
all connections of the specified session instance (ssn_inst); if a connection identifier (cid) is specified, only the statistics for that connection
will be displayed.
-V displays
negotiated login key information.
To display iscsiutil usage, use:
To issue an iSCSI NOP-OUT indicating the destination session
and connection, use:
# iscsiutil [/dev/iscsi] -n -S <ssn_inst> [-C <cid> ] [-L <data-size>]
|
-S provides an initiator
session identifier instance (ssn_inst) on which the iSCSI NOP-OUT is to be sent
-C provides a specific connection
identifier (cid) for the iSCSI NOP-OUT
-L is the <data-size>,
or number of bytes, to be used for the NOP-OUT. The valid range
for the data-size is 0 to 4096 bytes. The default data-size is 64
bytes.