iscsiadm

Langue: en

Version: 51612 (openSuse - 09/10/07)

Section: 8 (Commandes administrateur)

NAME

iscsiadm - open-iscsi administration utility

SYNOPSIS

iscsiadm -m discovery [ [ -dhV ] --print=[N] ] [ -I iface -t type -p ip:port [ -l ] ] | [ -o operation ] [ -n name ] [ -v value ]

iscsiadm -m node [ -dhV ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I iface ] [ -l | -u | -R | -s] ] [ [ -o operation ] [ -n name ] [ -v value ] [ -p ip:port ] ]

iscsiadm -m session [ -dhV ] [ -P printlevel ] [ -r sessionid | sysfsdir [ -R ] [ -u | -s ] ]

iscsiadm -m iface [ -dhV ] [ -P printlevel ] [ -I ifacename ] [ [ -o operation ] [ -n name ] [ -v value ] ]

DESCRIPTION

The iscsiadm utility is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database.

Open-iscsi does not use the term node as defined by the iSCSI RFC, where a node is a single iSCSI initiator or target. Open-iscsi uses the term node to refer to a portal on a target.

For session mode, a session id (sid) is used. The sid of a session can be found by running iscsiadm -m session -P 1. The session id and sysfs path are not currently persistent and is partially determined by when the session is setup.

Note that many of the node and discovery operations require that the iSCSI daemon (iscsid) be running.

OPTIONS

-d, --debug
print debugging information
-h, --help
display help text and exit
-I, --interface[iface]
The interface argument specifies the iSCSI interface to use for the operation. iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware or offload, the iface config must have the hardware address (iface.hwaddress) and the driver/transport_name (iface.transport_name). The iface's name is then the filename of the iface config. For software iSCSI, the iface config must have either the hardware address (iface.hwaddress), or the network layer's interface name (iface.net_ifacename), or the IP address of the NIC (iface.ipaddress), and it must have the driver/transport_name (iface.transport_name). Note that for software iSCSI using specifying the IP address does not bind the session through a specific NIC. We allow the network layer to decide which NIC to use, but packets from this host will use the address specific.

The available drivers/iscsi_transports are tcp (software iSCSI over TCP/IP), iser (software iSCSI over infinniband), or qla4xxx (Qlogic 4XXXX HBAs). The hwaddress is the MAC address or for software iSCSI it may be the special value "default" which directs the initiator to not bind the session to a specific hardware resource and instead allow the network or infinniband layer to decide what to do. There is no need to create a iface config with the default behavior. If you do not specify a iface, then the default behavior is used.

In discovery mode multiple interfaces can be specific by passing in multiple -I/--interface instances. For example,

"iscsiadm -m discovery -t st -p mytarget -I iface0 -I iface2"

Will direct iscsiadm to setup the node db to create records which will create sessions though the two intefaces passed in.

In node mode, only a single interface is supported in each call to iscsiadm.

This option is valid for discovery, node and iface mode.

-l, --login
For node mode, login to a specified record. For discovery mode, login to all discovered targets.
This option is only valid for discovery and node modes.
-L, --loginall==[all|manual|automatic]
For node mode, login all sessions with the node or conn startup values passed in or all running sesssion, except ones marked onboot, if all is passed in.
This option is only valid for node mode (it is valid but not functional for session mode).

-m, --mode op
specify the mode. op must be one of discovery, node, or session.
If no other options are specified: for discovery and node, all of their respective records are displayed; for session, all active sessions and connections are displayed.
-n, --name=name
Specify a field name in a record. For use with the update operator.

-o, --op=op
Specifies a database operator op. op must be one of new, delete, update or show.
This option is only valid for all modes, but delete should not be used on a running session.
new is currently valid only for node, session and iface mode. It creates a new database record for a given portal (IP address and port number).
delete deletes a specified recid.
update is currently valid only for node, session, and iface mode. It updates a specified recid with name to the specified value.
show is the default behaviour for node, discovery and iface mode. It is also used when there are no commands passed into session mode and a running sid is passed in. name and value are currently ignored when used with show.
-p, --portal=ip[:port]
Use target portal with ip-address ip and port, the default port value is 3260.
This option is only valid for discovery, or for node operations with the new operator.
This should be used along with --target in node mode, to specify what the open-iscsi docs refer to as a node or node record. Note: open-iscsi's use of the word node, does not match the iSCSI RFC's iSCSI Node term.
-P, --print=printlevel
If in node mode print nodes in tree format. If in session mode print sessions in tree format. If in discovery mode print the nodes in tree format.
-T, --targetname=targetname
Use target targetname.
This should be used along with --portal in node mode, to specify what the open-iscsi docs refer to as a node or node record. Note: open-iscsi's use of the word node, does not match the iSCSI RFC's iSCSI Node term.
-r, --sid=sid | sysfsdir
Use session ID sid. The sid of a session can be found from running iscsiadm in session mode with the --info argument.

Instead of sid, a sysfs path containing the session can be used. For example using one of the following: /sys/devices/platform/hostH/sessionS/targetH:B:I/H:B:I:L, /sys/devices/platform/hostH/sessionS/targetH:B:I, or /sys/devices/platform/hostH/sessionS, for the sysfsdir argument would result in the session with sid S to be used.

sid | sysfsdir is only required for session mode.
-R, --rescan
In session mode, if sid is also passed in rescan the session. If no sid has been passed in rescan all running sessions.

In node mode, rescan a session running through the target, portal, iface tuple passed in.

-s, --stats
Display session statistics.
-S, --show
When displaying records, do not hide masked values, such as the CHAP secret (password).
This option is only valid for node and session mode.
-t, --type=type
type must be sendtargets (or abbreviated as st), slp, or isns. Currently only sendtargets and iSNS is supported, see the DISCOVERY TYPES section.
This option is only valid for discovery mode.
-u, --logout
logout for a specified record.
This option is only valid for node and session mode.
-U, --logoutall==[all,manual,automatic]
logout all sessions with the node or conn startup values passed in or all running sesssion, except ones marked onboot, if all is passed in.
This option is only valid for node mode (it is valid but not functional for session mode).
-v, --value=value
Specify a value for use with the update operator.
This option is only valid for node mode.
-V, --version
display version and exit

DISCOVERY TYPES

iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.
SendTargets
A native iSCSI protocol which allows each iSCSI target to send a list of available targets to the initiator.
SLP
Optionally an iSCSI target can use the Service Location Protocol (SLP) to announce the available targets. The initiator can either implement SLP queries directly or can use a separate tool to acquire the information about available targets.
iSNS
iSNS (Internet Storage Name Service) records information about storage volumes within a larger network. To utilize iSNS, the address of the iSNS server must be set in iscsid.conf using the "isns.address" value, and iscsiadm must be run in discovery mode with the "isns" discovery type.

iSNS support in open-iscsi is experimental. The iscsid.conf settings, iscsiadm syntax and node DB layout may change.

iscsiadm supports the iSNS (isns) or SendTargets (st) discovery type. An SLP implementation is under development.

EXAMPLES


Discover targets at a given IP address:



        iscsiadm --mode discovery --type sendtargets --portal 192.168.1.10



Login, must use a node record id found by the discovery:



        iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login



Logout:



        iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout



List node records:



        iscsiadm --mode node





Display all data for a given node record:



        iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260



 

FILES

/etc/iscsi/iscsid.conf
The configuration file read by iscsid and iscsiadm on startup.
/etc/iscsi/initiatorname.iscsi
The file containing the iSCSI InitiatorName and InitiatorAlias read by iscsid and iscsiadm on startup.
/etc/iscsi/nodes/
This directory contains the nodes with their targets.
/etc/iscsi/send_targets
This directory contains the portals.

SEE ALSO

iscsid(8)

AUTHORS

Open-iSCSI project <http://www.open-iscsi.org/>
Alex Aizman <itn780@yahoo.com>
Dmitry Yusupov <dmitry_yus@yahoo.com>