summaryrefslogtreecommitdiff
path: root/doc/iscsiadm.8
blob: 6368d0d2fd0c042cbe4efbd6c18219b662f4f315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
.TH ISCSIADM 8 "Sep 2006" "" "Linux Administrator's Manual"
.SH NAME
iscsiadm \- open-iscsi administration utility
.SH SYNOPSIS
\fBiscsiadm\fR -m discovery [ -dhV ] [ -t type -p ip:port [ -l ] ] | 
[ -o operation ] [ -n name ] [ -v value ]

\fBiscsiadm\fR -m node [ -dhV ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port | -M sysdir ] [ -l | -u ] ]
[ [ -o operation ]  [ -n name ] [ -v value ] [ -p ip:port ] ]

\fBiscsiadm\fR -m session [ -dhV ] [ -r sessionid [ -u | -s ] ]

.SH "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.
.PP
Note that many of the node and discovery operations require that the iSCSI
daemon (iscsid) be running.

.SH OPTIONS

.TP
\fB\-d\fR, \fB\-\-debug\fR
print debugging information

.TP
\fB\-h\fR, \fB\-\-help\fR
display help text and exit

.TP
\fB\-l\fR, \fB\-\-login\fR
For node mode, login to a specified record. For discovery mode, login to
all discovered targets.
.IP
This option is only valid for discovery and node modes.

.TP
\fB\-L\fR, \fB\-\-loginall==\fI[all,manual,automatic]\fR
For node mode, login all sessions with the node.startup values passed in
or all running sesssion, except ones marked onboot, if all is passed in.
.IP
This option is only valid for node mode (it is valid but not functional
for session mode).


.TP
\fB\-m, \-\-mode \fIop\fR
specify the mode. \fIop\fR
must be one of \fIdiscovery\fR, \fInode\fR, or \fIsession\fR.
.IP
If no other options are specified: for \fIdiscovery\fR and \fInode\fR, all
of their respective records are displayed; for \fIsession\fR, all active
sessions and connections are displayed.

.TP
\fB\-M, \-\-map \fIdir\fR
Use the record id associated with the sysfs open-iscsi directory
\fIdir\fR, where \fIdir\fR is the directory of the corresponding
scsi device, for example:

.ft R
	/sys/devices/platform/host0/session0/target0:0:0/0:0:0:0
.IP
Valid only in node mode, and cannot be used with the \fB\-r\fR option.

.TP
\fB\-n\fR, \fB\-\-name=\fIname\fR
Specify a field \fIname\fR in a record. For use with the \fIupdate\fR
operator.
.IP

.TP
\fB\-o\fR, \fB\-\-op=\fIop\fR
Specifies a database operator \fIop\fR. \fIop\fR must be one of
\fInew\fR, \fIdelete\fR, \fIupdate\fR or \fIshow\fR.
.IP
This option is only valid for discovery and node modes.
.IP
\fInew\fR is currently valid only for node mode, it creates a new database
record for a given \fIportal\fR (IP address and port number).
.IP
\fIdelete\fR deletes a specified \fIrecid\fR.
.IP
\fIupdate\fR is currently valid only for node mode, it updates a specified
\fIrecid\fR with \fIname\fR to the specified \fIvalue\fR.
.IP
\fIshow\fR is the default behaviour for node and discovery modes,
\fIname\fR and \fIvalue\fR are currently ignored when used with \fIshow\fR.

.TP
\fB\-p\fR, \fB\-\-portal=\fIip[:port]\fR
Use target portal with ip-address \fIip\fR and \fIport\fR, the default
\fIport\fR value is 3260.
.IP
This option is only valid for discovery, or for node operations with
the \fInew\fR operator.

.TP
\fB\-T\fR, \fB\-\-targetname=\fItargetname\fR
Use target \fItargetname\fR.

.TP
\fB\-r\fR,  \fB\-\-sid=\fIsid\fR
Use session ID \fIsid\fR.
.IP
\fIsid\fR is only required for session mode.

.TP
\fB\-s\fR, \fB\-\-stats\fR
Display session statistics.
.IP
This option is only valid for session mode.

.TP
\fB\-S\fR, \fB\-\-show\fR
When displaying records, do not hide masked values, such as the CHAP
secret (password).
.IP
This option is only valid for node mode.

.TP
\fB\-t\fR, \fB\-\-type=\fItype\fR
\fItype\fR must be \fIsendtargets\fR (or abbreviated as \fIst\fR),
\fIslp\fR, or \fIisns\fR. Currently only sendtargets is supported, see the
DISCOVERY TYPES section.
.IP
This option is only valid for discovery mode.

.TP
\fB\-u\fR, \fB\-\-logout\fR
logout for a specified record.
.IP
This option is only valid for node mode (it is valid but not functional
for session mode).

.TP
\fB\-U\fR, \fB\-\-logoutall==\fI[all,manual,automatic]\fR
logout all sessions with the node.startup values passed in or all
running sesssion, except ones marked onboot, if all is passed in.
.IP
This option is only valid for node mode (it is valid but not functional
for session mode).

.TP
\fB\-v\fR, \fB\-\-value=\fIvalue\fR
Specify a \fIvalue\fR for use with the \fIupdate\fR operator.
.IP
This option is only valid for node mode.

.TP
\fB\-V\fR, \fB\-\-version\fR
display version and exit

.SH DISCOVERY TYPES
iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.

.TP
.B
SendTargets 
A native iSCSI protocol which allows each iSCSI
target to send a list of available targets to the initiator.

.TP
.B
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.

.TP
.B
iSNS
iSNS (Internet Storage Name Service) is a proposed standard to record
information about storage volumes within a larger network. In theory
it can be implemented for iSCSI and Fibre Channel. However, no
implementation of the central nameserver mandated by this standard is
currently available.
.P
Currently open-iscsi supports only the
.B
SendTargets
or
.B
st
discovery type. An SLP implementation is under development.

.SH EXAMPLES

.nf
Discover targets at a given IP address:

.ft R
	iscsiadm --mode discovery --type sendtargets --portal 192.168.1.10
.nf

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

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

Logout:

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

List node records:

.ft R
	iscsiadm --mode node

.nf

Display all data for a given node record:

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

.SH FILES
.TP
/etc/iscsi/iscsid.conf
The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP
/etc/iscsi/initiatorname.iscsi
The file containing the iSCSI InitiatorName and InitiatorAlias read by
\fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP
/etc/iscsi/nodes/
This directory contains the nodes with their targets.
.TP
/etc/iscsi/send_targets
This directory contains the portals.

.SH "SEE ALSO"
.BR iscsid (8)

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