1ISCSIADM(8) Linux Administrator's Manual ISCSIADM(8)
2
3
4
6 iscsiadm - open-iscsi administration utility
7
9 iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [ -P printlevel ] [
10 -I iface -t type -p ip:port [ -lD ] ] | [ [ -p ip:port -t type ] [ -o
11 operation ] [ -n name ] [ -v value ] [ -lD ] ]
12
13 iscsiadm -m discovery [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I
14 iface -t type -p ip:port [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ]
15
16 iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L
17 all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T tar‐
18 getname -p ip:port -I iface ] [ -l | -u | -R | -s] ] [ [ -o operation ]
19 [ -n name ] [ -v value ] [ -p ip:port ] ]
20
21 iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -r
22 sessionid | sysfsdir [ -R ] [ -u | -s | -o new ] ]
23
24 iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I
25 ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v
26 value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i
27 interval ] ]
28
29 iscsiadm -m fw [-l]
30
31 iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -x
32 chap_tbl_idx ] ] | [ -C flashnode [ -A portal_type ] [ -x flashnode_idx
33 ] ] | [ -C stats ] ] [ [ -o operation ] [ -n name ] [ -v value ] ]
34
35 iscsiadm -k priority
36
37
39 The iscsiadm utility is a command-line tool allowing discovery and
40 login to iSCSI targets, as well as access and management of the open-
41 iscsi database.
42
43 Open-iscsi does not use the term node as defined by the iSCSI RFC,
44 where a node is a single iSCSI initiator or target. Open-iscsi uses the
45 term node to refer to a portal on a target.
46
47 For session mode, a session id (sid) is used. The sid of a session can
48 be found by running iscsiadm -m session -P 1. The session id and sysfs
49 path are not currently persistent and is partially determined by when
50 the session is setup.
51
52
53 Note that many of the node and discovery operations require that the
54 iSCSI daemon (iscsid) be running.
55
56
58 -a, --ip=ipaddr
59 ipaddr can be IPv4 or IPv6.
60
61 This option is only valid for ping submode.
62
63
64 -A, --portal_type=[ipv4|ipv6]
65 Specify the portal type for the new flash node entry to be cre‐
66 ated.
67
68 This option is only valid for flashnode submode of host mode and
69 only with new operation.
70
71
72 -b, --packetsize=packetsize
73 Specify the ping packetsize.
74
75 This option is only valid for ping submode.
76
77
78 -c, --count=count
79 count specify number of ping iterations.
80
81 This option is only valid for ping submode.
82
83
84 -C, --submode=op
85 Specify the submode for mode. op must be name of submode.
86
87 Currently iscsiadm support ping as submode for iface. For exam‐
88 ple,
89
90 iscsiadm -m iface -I ifacename -C ping -a ipaddr -b packetsize
91 -c count -i interval
92
93 For host, it supports chap , flashnode and stats as submodes.
94 For example,
95
96 iscsiadm -m host -H hostno -C chap -x chap_tbl_idx -o operation
97
98 iscsiadm -m host -H hostno -C flashnode -x flashnode_idx -o
99 operation
100
101 iscsiadm -m host -H hostno -C stats
102
103
104 -d, --debug=debug_level
105 print debugging information. Valid values for debug_level are 0
106 to 8.
107
108
109 -h, --help
110 display help text and exit
111
112
113 -H, --host=[hostno|MAC]
114 The host agrument specifies the SCSI host to use for the opera‐
115 tion. It can be the scsi host number assigned to the host by the
116 kernel's scsi layer, or the MAC address of a scsi host.
117
118
119 -i, --interval=interval
120 interval specify delay between two ping iterations.
121
122 This option is only valid for ping submode.
123
124
125 -I, --interface=[iface]
126 The interface argument specifies the iSCSI interface to use for
127 the operation. iSCSI interfaces (iface) are defined in
128 /var/lib/iscsi/ifaces. For hardware iSCSI (qla4xxx) the iface
129 config must have the hardware address (iface.hwaddress = port's
130 MAC address) and the driver/transport_name (iface.trans‐
131 port_name). The iface's name is then the filename of the iface
132 config. For software iSCSI, the iface config must have either
133 the hardware address (iface.hwaddress), or the network layer's
134 interface name (iface.net_ifacename), and it must have the
135 driver/transport_name
136
137 The available drivers/iscsi_transports are tcp (software iSCSI
138 over TCP/IP), iser (software iSCSI over infinniband), or qla4xxx
139 (Qlogic 4XXXX HBAs). The hwaddress is the MAC address or for
140 software iSCSI it may be the special value "default" which
141 directs the initiator to not bind the session to a specific
142 hardware resource and instead allow the network or infinniband
143 layer to decide what to do. There is no need to create a iface
144 config with the default behavior. If you do not specify a iface,
145 then the default behavior is used.
146
147 As mentioned above there is a special iface name default. There
148 are three others -- cxgb3i, bnx2i and iser, which does not bind
149 the session to a specific card, but will bind the session to the
150 cxgb3i, bnx2i or iser transport. These are experimental and the
151 use is not supported as a stable interface yet.
152
153 In discovery mode multiple interfaces can be specified by pass‐
154 ing in multiple -I/--interface instances. For example,
155
156 "iscsiadm -m discoverydb -t st -p ip:port -I iface0 -I iface2
157 --discover"
158
159 Will direct iscsiadm to setup the node db to create records
160 which will create sessions though the two intefaces passed in.
161
162 In node mode, only a single interface is supported in each call
163 to iscsiadm.
164
165 This option is valid for discovery, node and iface mode.
166
167
168 -k, --killiscsid=[priority]
169 Currently priority must be zero. This will immediately stop all
170 iscsid operations and shutdown iscsid. It does not logout any
171 sessions. Running this command is the same as doing "killall
172 iscsid". Neither should normally not be used, because if iscsid
173 is doing error recovery or if there is an error while iscsid is
174 not running, the system may not be able to recover. This com‐
175 mand and iscsid's SIGTERM handling are experimental.
176
177
178 -D, --discover
179 Discover targets using the discovery record with the recid
180 matching the the discovery type and portal passed in. If there
181 is no matching record, it will be created using the iscsid.conf
182 discovery settings. This must be passed in discoverydb mode to
183 instruct iscsiadm to perform discovery.
184
185 This option is only valid for SendTargets discovery mode.
186
187
188 -l, --login
189 For node and fw mode, login to a specified record. For discovery
190 mode, login to all discovered targets.
191
192 This option is only valid for discovery and node modes.
193
194
195 -L, --loginall==[all|manual|automatic]
196 For node mode, login all sessions with the node or conn startup
197 values passed in or all running sesssion, except ones marked
198 onboot, if all is passed in.
199
200 This option is only valid for node mode (it is valid but not
201 functional for session mode).
202
203
204
205 -m, --mode op
206 specify the mode. op must be one of discoverydb, node, fw, host
207 iface or session.
208
209 If no other options are specified: for discoverydb and node, all
210 of their respective records are displayed; for session, all
211 active sessions and connections are displayed; for fw, all boot
212 firmware values are displayed; for host, all iSCSI hosts are
213 displayed; and for iface, all ifaces setup in
214 /var/lib/iscsi/ifaces are displayed.
215
216
217 -n, --name=name
218 In node mode, specify a field name in a record. In flashnode
219 submode of host mode, specify name of the flash node parameter.
220
221 For use with the update operator.
222
223 -o, --op=op
224 Specifies a database operator op. op must be one of new, delete,
225 update, show or nonpersistent.
226
227 For iface mode, apply and applyall are also applicable.
228
229 For flashnode submode of host mode, login and logout are also
230 applicable.
231
232 This option is valid for all modes except fw. Delete should not
233 be used on a running session. If it is iscsiadm will stop the
234 session and then delete the record.
235
236 new creates a new database record for a given object. In node
237 mode, the recid is the target name and portal (IP:port). In
238 iface mode, the recid is the iface name. In discovery mode, the
239 recid is the portal and discovery type.
240
241 In session mode, the new operation logs in a new session using
242 the same node database and iface information as the specified
243 session.
244
245 In discovery mode, if the recid and new operation is passed in,
246 but the --discover argument is not, then iscsiadm will only cre‐
247 ate a discovery record (it will not perform discovery). If the
248 --discover argument is passed in with the portal and discovery
249 type, then iscsiadm will create the discovery record if needed,
250 and it will create records for portals returned by the target
251 that do not yet have a node DB record.
252
253 delete deletes a specified recid. In discovery node, if iscsiadm
254 is performing discovery it will delete records for portals that
255 are no longer returned.
256
257 update will update the recid with name to the specified value.
258 In discovery node, if iscsiadm is performing discovery the
259 recid, name and value arguments are not needed. The update
260 operation will operate on the portals returned by the target,
261 and will update the node records with info from the config file
262 and command line.
263
264 show is the default behaviour for node, discovery and iface
265 mode. It is also used when there are no commands passed into
266 session mode and a running sid is passed in. name and value are
267 currently ignored when used with show.
268
269 nonpersistent instructs iscsiadm to not manipulate the node DB.
270
271
272 apply will cause the network settings to take effect on the
273 specified iface.
274
275
276 applyall will cause the network settings to take effect on all
277 the ifaces whose MAC address or host number matches that of the
278 specific host.
279
280
281 login will log into the specified flash node entry.
282
283
284 logout does the logout from the given flash node entry.
285
286
287 -p, --portal=ip[:port]
288 Use target portal with ip-address ip and port. If port is not
289 passed in the default port value is 3260.
290
291 IPv6 addresses can bs specified as [ddd.ddd.ddd.ddd]:port or
292 ddd.ddd.ddd.ddd.
293
294 Hostnames can also be used for the ip argument.
295
296
297 This option is only valid for discovery, or for node operations
298 with the new operator.
299
300 This should be used along with --target in node mode, to specify
301 what the open-iscsi docs refer to as a node or node record.
302 Note: open-iscsi's use of the word node, does not match the
303 iSCSI RFC's iSCSI Node term.
304
305
306 -P, --print=printlevel
307 If in node mode print nodes in tree format. If in session mode
308 print sessions in tree format. If in discovery mode print the
309 nodes in tree format.
310
311
312 -T, --targetname=targetname
313 Use target targetname.
314
315 This should be used along with --portal in node mode, to specify
316 what the open-iscsi docs refer to as a node or node record.
317 Note: open-iscsi's use of the word node, does not match the
318 iSCSI RFC's iSCSI Node term.
319
320
321 -r, --sid=sid | sysfsdir
322 Use session ID sid. The sid of a session can be found from run‐
323 ning iscsiadm in session mode with the --info argument.
324
325 Instead of sid, a sysfs path containing the session can be used.
326 For example using one of the following: /sys/devices/plat‐
327 form/hostH/sessionS/targetH:B:I/H:B:I:L, /sys/devices/plat‐
328 form/hostH/sessionS/targetH:B:I, or /sys/devices/plat‐
329 form/hostH/sessionS, for the sysfsdir argument would result in
330 the session with sid S to be used.
331
332 sid | sysfsdir is only required for session mode.
333
334
335 -R, --rescan
336 In session mode, if sid is also passed in rescan the session. If
337 no sid has been passed in rescan all running sessions.
338
339 In node mode, rescan a session running through the target, por‐
340 tal, iface tuple passed in.
341
342
343 -s, --stats
344 Display session statistics. This option when used with host
345 mode, displays host statistics.
346
347
348 -S, --show
349 When displaying records, do not hide masked values, such as the
350 CHAP secret (password).
351
352 This option is only valid for node and session mode.
353
354
355 -t, --type=type
356 type must be sendtargets (or abbreviated as st), slp, isns or
357 fw. Currently only sendtargets, fw, and iSNS is supported, see
358 the DISCOVERY TYPES section.
359
360 This option is only valid for discovery mode.
361
362
363 -u, --logout
364 logout for a specified record.
365
366 This option is only valid for node and session mode.
367
368
369 -U, --logoutall==[all,manual,automatic]
370 logout all sessions with the node or conn startup values passed
371 in or all running sesssion, except ones marked onboot, if all is
372 passed in.
373
374 This option is only valid for node mode (it is valid but not
375 functional for session mode).
376
377
378 -v, --value=value
379 Specify a value for use with the update operator.
380
381 This option is only valid for node mode and flashnode submode of
382 host mode.
383
384
385 -V, --version
386 display version and exit
387
388
389 -x, --index=index
390 Specify the index of the entity to operate on.
391
392 This option is only valid for chap and flashnode submodes of
393 host mode.
394
395
397 iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.
398
399
400 SendTargets
401 A native iSCSI protocol which allows each iSCSI target to send a
402 list of available targets to the initiator.
403
404
405 SLP Optionally an iSCSI target can use the Service Location Protocol
406 (SLP) to announce the available targets. The initiator can
407 either implement SLP queries directly or can use a separate tool
408 to acquire the information about available targets.
409
410
411 iSNS iSNS (Internet Storage Name Service) records information about
412 storage volumes within a larger network. To utilize iSNS, pass
413 the address and optionally the port of the iSNS server to do
414 discovery to.
415
416
417 fw Several NICs and systems contain a mini iSCSI initiator which
418 can be used for boot. To get the values used for boot the fw
419 option can be used. Doing fw discovery, does not store persis‐
420 tent records in the node or discovery DB, because the values are
421 stored in the system's or NIC's resource.
422
423 Performing fw discovery will print the portals, like with other
424 discovery methods. To see other settings like CHAP values and
425 initiator settings, like you would in node mode, run "iscsiadm
426 -m fw".
427
428 fw support in open-iscsi is experimental. The settings and isc‐
429 siadm syntax and output format may change.
430
431
432 iscsiadm supports the iSNS (isns) or SendTargets (st) discovery type.
433 An SLP implementation is under development.
434
435
437 On success 0 is returned. On error one of the return codes below will
438 be returned.
439
440 Commands that operation on multiple objects (sessions, records, etc),
441 iscsiadm/iscsistart will return the first error that is encountered.
442 iscsiadm/iscsistart will attempt to execute the operation on the
443 objects it can. If no objects are found ISCSI_ERR_NO_OBJS_FOUND is
444 returned.
445
446
447
448 0 ISCSI_SUCCESS - command executed successfully.
449
450
451 1 ISCSI_ERR - generic error code.
452
453
454 2 ISCSI_ERR_SESS_NOT_FOUND - session could not be found.
455
456
457 3 ISCSI_ERR_NOMEM - could not allocate resource for operation.
458
459 4 ISCSI_ERR_TRANS - connect problem caused operation to fail.
460
461
462 5 ISCSI_ERR_LOGIN - generic iSCSI login failure.
463
464
465 6 ISCSI_ERR_IDBM - error accessing/managing iSCSI DB.
466
467
468 7 ISCSI_ERR_INVAL - invalid argument.
469
470
471 8 ISCSI_ERR_TRANS_TIMEOUT - connection timer exired while trying
472 to connect.
473
474
475 9 ISCSI_ERR_INTERNAL - generic internal iscsid/kernel failure.
476
477
478 10 ISCSI_ERR_LOGOUT - iSCSI logout failed.
479
480
481 11 ISCSI_ERR_PDU_TIMEOUT - iSCSI PDU timedout.
482
483
484 12 ISCSI_ERR_TRANS_NOT_FOUND - iSCSI transport module not loaded in
485 kernel or iscsid.
486
487
488 13 ISCSI_ERR_ACCESS - did not have proper OS permissions to access
489 iscsid or execute iscsiadm command.
490
491
492 14 ISCSI_ERR_TRANS_CAPS - transport module did not support opera‐
493 tion.
494
495
496 15 ISCSI_ERR_SESS_EXISTS - session is logged in.
497
498
499 16 ISCSI_ERR_INVALID_MGMT_REQ - invalid IPC MGMT request.
500
501
502 17 ISCSI_ERR_ISNS_UNAVAILABLE - iSNS service is not supported.
503
504
505 18 ISCSI_ERR_ISCSID_COMM_ERR - a read/write to iscsid failed.
506
507
508 19 ISCSI_ERR_FATAL_LOGIN - fatal iSCSI login error.
509
510
511 20 ISCSI_ERR_ISCSID_NOTCONN - could ont connect to iscsid.
512
513
514 21 ISCSI_ERR_NO_OBJS_FOUND - no records/targets/sessions/portals
515 found to execute operation on.
516
517
518 22 ISCSI_ERR_SYSFS_LOOKUP - could not lookup object in sysfs.
519
520
521 23 ISCSI_ERR_HOST_NOT_FOUND - could not lookup host.
522
523
524 24 ISCSI_ERR_LOGIN_AUTH_FAILED - login failed due to authorization
525 failure.
526
527
528 25 ISCSI_ERR_ISNS_QUERY - iSNS query failure.
529
530
531 26 ISCSI_ERR_ISNS_REG_FAILED - iSNS registration/deregistration
532 failed.
533
534
535
537 Discover targets at a given IP address:
538
539 iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover
540
541 Login, must use a node record id found by the discovery:
542
543 iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login
544
545 Logout:
546
547 iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout
548
549 List node records:
550
551 iscsiadm --mode node
552
553
554 Display all data for a given node record:
555
556 iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260
557
558
560 /etc/iscsi/iscsid.conf
561 The configuration file read by iscsid and iscsiadm on startup.
562
563 /etc/iscsi/initiatorname.iscsi
564 The file containing the iSCSI InitiatorName and InitiatorAlias
565 read by iscsid and iscsiadm on startup.
566
567 /var/lib/iscsi/nodes/
568 This directory contains the nodes with their targets.
569
570 /var/lib/iscsi/send_targets
571 This directory contains the portals.
572
573
575 iscsid(8)
576
577
579 Open-iSCSI project <http://www.open-iscsi.org/>
580 Alex Aizman <itn780@yahoo.com>
581 Dmitry Yusupov <dmitry_yus@yahoo.com>
582
583
584
585 Sep 2006 ISCSIADM(8)