1ISCSIADM(8)              Linux Administrator's Manual              ISCSIADM(8)
2
3
4

NAME

6       iscsiadm - open-iscsi administration utility
7

SYNOPSIS

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 ] ]
23
24       iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P  printlevel  ]  [  -I
25       ifacename ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]
26
27       iscsiadm -m fw [-l]
28
29       iscsiadm -m host [ -P printlevel ] [ -H hostno ]
30
31       iscsiadm -k priority
32
33

DESCRIPTION

35       The  iscsiadm  utility  is  a  command-line tool allowing discovery and
36       login to iSCSI targets, as well as access and management of  the  open-
37       iscsi database.
38
39       Open-iscsi  does  not  use  the  term node as defined by the iSCSI RFC,
40       where a node is a single iSCSI initiator or target. Open-iscsi uses the
41       term node to refer to a portal on a target.
42
43       For  session mode, a session id (sid) is used. The sid of a session can
44       be found by running iscsiadm -m session -P 1. The session id and  sysfs
45       path  are  not currently persistent and is partially determined by when
46       the session is setup.
47
48
49       Note that many of the node and discovery operations  require  that  the
50       iSCSI daemon (iscsid) be running.
51
52

OPTIONS

54       -d, --debug=debug_level
55              print  debugging information. Valid values for debug_level are 0
56              to 8.
57
58
59       -h, --help
60              display help text and exit
61
62
63       -I, --interface[iface]
64              The interface argument specifies the iSCSI interface to use  for
65              the   operation.    iSCSI  interfaces  (iface)  are  defined  in
66              /var/lib/iscsi/ifaces. For hardware iSCSI  (qla4xxx)  the  iface
67              config  must have the hardware address (iface.hwaddress = port's
68              MAC  address)  and   the   driver/transport_name   (iface.trans‐
69              port_name).  The  iface's name is then the filename of the iface
70              config. For software iSCSI, the iface config  must  have  either
71              the  hardware  address (iface.hwaddress), or the network layer's
72              interface name  (iface.net_ifacename),  and  it  must  have  the
73              driver/transport_name
74
75              The  available  drivers/iscsi_transports are tcp (software iSCSI
76              over TCP/IP), iser (software iSCSI over infinniband), or qla4xxx
77              (Qlogic  4XXXX  HBAs).  The  hwaddress is the MAC address or for
78              software iSCSI it may  be  the  special  value  "default"  which
79              directs  the  initiator  to  not  bind the session to a specific
80              hardware resource and instead allow the network  or  infinniband
81              layer  to  decide what to do. There is no need to create a iface
82              config with the default behavior. If you do not specify a iface,
83              then the default behavior is used.
84
85              As  mentioned above there is a special iface name default. There
86              are three others -- cxgb3i, bnx2i and iser, which does not  bind
87              the session to a specific card, but will bind the session to the
88              cxgb3i, bnx2i or iser transport. These are experimental and  the
89              use is not supported as a stable interface yet.
90
91              In  discovery mode multiple interfaces can be specified by pass‐
92              ing in multiple -I/--interface instances. For example,
93
94              "iscsiadm -m discoverydb -t st -p ip:port -I  iface0  -I  iface2
95              --discover"
96
97              Will  direct  iscsiadm  to  setup  the node db to create records
98              which will create sessions though the two intefaces passed in.
99
100              In node mode, only a single interface is supported in each  call
101              to iscsiadm.
102
103              This option is valid for discovery, node and iface mode.
104
105
106       -k, --killiscsid=[priority]
107              Currently  priority must be zero. This will immediately stop all
108              iscsid operations and shutdown iscsid. It does  not  logout  any
109              sessions.  Running  this  command  is the same as doing "killall
110              iscsid". Neither should normally not be used, because if  iscsid
111              is  doing error recovery or if there is an error while iscsid is
112              not running, the system may not be able to recover.   This  com‐
113              mand and iscsid's SIGTERM handling are experimental.
114
115
116       -D, --discover
117              Discover  targets  using  the  discovery  record with the  recid
118              matching the the discovery type and portal passed in.  If  there
119              is  no matching record, it will be created using the iscsid.conf
120              discovery settings.  This must be passed in discoverydb mode  to
121              instruct iscsiadm to perform discovery.
122
123              This option is only valid for SendTargets discovery mode.
124
125
126       -l, --login
127              For node and fw mode, login to a specified record. For discovery
128              mode, login to all discovered targets.
129
130              This option is only valid for discovery and node modes.
131
132
133       -L, --loginall==[all|manual|automatic]
134              For node mode, login all sessions with the node or conn  startup
135              values  passed  in  or  all running sesssion, except ones marked
136              onboot, if all is passed in.
137
138              This option is only valid for node mode (it  is  valid  but  not
139              functional for session mode).
140
141
142
143       -m, --mode op
144              specify  the mode. op must be one of discoverydb, node, fw, host
145              iface or session.
146
147              If no other options are specified: for discoverydb and node, all
148              of  their  respective  records  are  displayed; for session, all
149              active sessions and connections are displayed; for fw, all  boot
150              firmware  values  are  displayed;  for host, all iSCSI hosts are
151              displayed;   and   for    iface,    all    ifaces    setup    in
152              /var/lib/iscsi/ifaces are displayed.
153
154
155       -n, --name=name
156              Specify a field name in a record. For use with the update opera‐
157              tor.
158
159       -o, --op=op
160              Specifies a database operator op. op must be one of new, delete,
161              update, show or nonpersistent.
162
163              This  option is valid for all modes except fw. Delete should not
164              be used on a running session. If it is iscsiadm  will  stop  the
165              session and then delete the record.
166
167              new  creates  a  new database record for a given object. In node
168              mode, the recid is the target  name  and  portal  (IP:port).  In
169              iface  mode, the recid is the iface name. In discovery mode, the
170              recid is the portal and discovery type.
171
172
173              In discovery mode, if the recid and new operation is passed  in,
174              but the --discover argument is not, then iscsiadm will only cre‐
175              ate a discovery record (it will not perform discovery).  If  the
176              --discover  argument  is passed in with the portal and discovery
177              type, then iscsiadm will create the discovery record if  needed,
178              and  it  will  create records for portals returned by the target
179              that do not yet have a node DB record.
180
181              delete deletes a specified recid. In discovery node, if iscsiadm
182              is  performing discovery it will delete records for portals that
183              are no longer returned.
184
185              update will update the recid with name to the  specified  value.
186              In  discovery  node,  if  iscsiadm  is  performing discovery the
187              recid, name  and value arguments  are  not  needed.  The  update
188              operation  will  operate  on the portals returned by the target,
189              and will update the node records with info from the config  file
190              and command line.
191
192              show  is  the  default  behaviour  for node, discovery and iface
193              mode. It is also used when there are  no  commands  passed  into
194              session mode and a running sid is passed in.  name and value are
195              currently ignored when used with show.
196
197              nonpersistent instructs iscsiadm to not manipulate the node DB.
198
199
200       -p, --portal=ip[:port]
201              Use target portal with ip-address ip and port, the default  port
202              value is 3260.
203
204              This  option is only valid for discovery, or for node operations
205              with the new operator.
206
207              This should be used along with --target in node mode, to specify
208              what  the  open-iscsi  docs  refer  to as a node or node record.
209              Note: open-iscsi's use of the word  node,  does  not  match  the
210              iSCSI RFC's iSCSI Node term.
211
212
213       -P,  --print=printlevel
214              If  in  node mode print nodes in tree format. If in session mode
215              print sessions in tree format. If in discovery  mode  print  the
216              nodes in tree format.
217
218
219       -T, --targetname=targetname
220              Use target targetname.
221
222              This should be used along with --portal in node mode, to specify
223              what the open-iscsi docs refer to as  a  node  or  node  record.
224              Note:  open-iscsi's  use  of  the  word node, does not match the
225              iSCSI RFC's iSCSI Node term.
226
227
228       -r,  --sid=sid | sysfsdir
229              Use session ID sid. The sid of a session can be found from  run‐
230              ning iscsiadm in session mode with the --info argument.
231
232              Instead of sid, a sysfs path containing the session can be used.
233              For example  using  one  of  the  following:  /sys/devices/plat‐
234              form/hostH/sessionS/targetH:B:I/H:B:I:L,      /sys/devices/plat‐
235              form/hostH/sessionS/targetH:B:I,      or      /sys/devices/plat‐
236              form/hostH/sessionS,  for  the sysfsdir argument would result in
237              the session with sid S to be used.
238
239              sid | sysfsdir is only required for session mode.
240
241
242       -R,  --rescan
243              In session mode, if sid is also passed in rescan the session. If
244              no sid has been passed in  rescan all running sessions.
245
246              In  node mode, rescan a session running through the target, por‐
247              tal, iface tuple passed in.
248
249
250       -s, --stats
251              Display session statistics.
252
253
254       -S, --show
255              When displaying records, do not hide masked values, such as  the
256              CHAP secret (password).
257
258              This option is only valid for node and session mode.
259
260
261       -t, --type=type
262              type  must  be  sendtargets (or abbreviated as st), slp, isns or
263              fw. Currently only sendtargets, fw, and iSNS is  supported,  see
264              the DISCOVERY TYPES section.
265
266              This option is only valid for discovery mode.
267
268
269       -u, --logout
270              logout for a specified record.
271
272              This option is only valid for node and session mode.
273
274
275       -U, --logoutall==[all,manual,automatic]
276              logout  all sessions with the node or conn startup values passed
277              in or all running sesssion, except ones marked onboot, if all is
278              passed in.
279
280              This  option  is  only  valid for node mode (it is valid but not
281              functional for session mode).
282
283
284       -v, --value=value
285              Specify a value for use with the update operator.
286
287              This option is only valid for node mode.
288
289
290       -V, --version
291              display version and exit
292
293

DISCOVERY TYPES

295       iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.
296
297
298       SendTargets
299              A native iSCSI protocol which allows each iSCSI target to send a
300              list of available targets to the initiator.
301
302
303       SLP    Optionally an iSCSI target can use the Service Location Protocol
304              (SLP) to announce  the  available  targets.  The  initiator  can
305              either implement SLP queries directly or can use a separate tool
306              to acquire the information about available targets.
307
308
309       iSNS   iSNS (Internet Storage Name Service) records  information  about
310              storage  volumes  within a larger network. To utilize iSNS, pass
311              the address and optionally the port of the  iSNS  server  to  do
312              discovery to.
313
314
315       fw     Several  NICs  and  systems contain a mini iSCSI initiator which
316              can be used for boot. To get the values used  for  boot  the  fw
317              option  can be used.  Doing fw discovery, does not store persis‐
318              tent records in the node or discovery DB, because the values are
319              stored in the system's or NIC's resource.
320
321              Performing  fw discovery will print the portals, like with other
322              discovery methods. To see other settings like  CHAP  values  and
323              initiator  settings,  like you would in node mode, run "iscsiadm
324              -m fw".
325
326              fw support in open-iscsi is experimental. The settings and  isc‐
327              siadm syntax and output format may change.
328
329
330       iscsiadm  supports  the iSNS (isns) or SendTargets (st) discovery type.
331       An SLP implementation is under development.
332
333

EXAMPLES

335       Discover targets at a given IP address:
336
337            iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover
338
339       Login, must use a node record id found by the discovery:
340
341            iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login
342
343       Logout:
344
345            iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout
346
347       List node records:
348
349            iscsiadm --mode node
350
351
352       Display all data for a given node record:
353
354            iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260
355
356

FILES

358       /etc/iscsi/iscsid.conf
359              The configuration file read by iscsid and iscsiadm on startup.
360
361       /etc/iscsi/initiatorname.iscsi
362              The file containing the iSCSI InitiatorName  and  InitiatorAlias
363              read by iscsid and iscsiadm on startup.
364
365       /var/lib/iscsi/nodes/
366              This directory contains the nodes with their targets.
367
368       /var/lib/iscsi/send_targets
369              This directory contains the portals.
370
371

SEE ALSO

373       iscsid(8)
374
375

AUTHORS

377       Open-iSCSI project <http://www.open-iscsi.org/>
378       Alex Aizman <itn780@yahoo.com>
379       Dmitry Yusupov <dmitry_yus@yahoo.com>
380
381
382
383                                   Sep 2006                        ISCSIADM(8)
Impressum