]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/iscsictl/iscsictl.8
MFV r324198: 8081 Compiler warnings in zdb
[FreeBSD/FreeBSD.git] / usr.bin / iscsictl / iscsictl.8
1 .\" Copyright (c) 2012 The FreeBSD Foundation
2 .\" All rights reserved.
3 .\"
4 .\" This software was developed by Edward Tomasz Napierala under sponsorship
5 .\" from the FreeBSD Foundation.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd May 6, 2016
31 .Dt ISCSICTL 8
32 .Os
33 .Sh NAME
34 .Nm iscsictl
35 .Nd iSCSI initiator management utility
36 .Sh SYNOPSIS
37 .Nm
38 .Fl A
39 .Fl p Ar portal Fl t Ar target
40 .Op Fl u Ar user Fl s Ar secret
41 .Op Fl w Ar timeout
42 .Op Fl r
43 .Op Fl e Cm on | off
44 .Nm
45 .Fl A
46 .Fl d Ar discovery-host
47 .Op Fl u Ar user Fl s Ar secret
48 .Op Fl r
49 .Op Fl e Cm on | off
50 .Nm
51 .Fl A
52 .Fl a Op Fl c Ar path
53 .Nm
54 .Fl A
55 .Fl n Ar nickname Op Fl c Ar path
56 .Nm
57 .Fl M
58 .Fl i Ar session-id
59 .Op Fl p Ar portal
60 .Op Fl t Ar target
61 .Op Fl u Ar user
62 .Op Fl s Ar secret
63 .Op Fl e Cm on | off
64 .Nm
65 .Fl M
66 .Fl i Ar session-id
67 .Op Fl n Ar nickname Op Fl c Ar path
68 .Nm
69 .Fl R
70 .Op Fl p Ar portal
71 .Op Fl t Ar target
72 .Nm
73 .Fl R
74 .Fl a
75 .Nm
76 .Fl R
77 .Fl n Ar nickname Op Fl c Ar path
78 .Nm
79 .Fl L
80 .Op Fl v
81 .Op Fl w Ar timeout
82 .Sh DESCRIPTION
83 The
84 .Nm
85 utility is used to configure the iSCSI initiator.
86 .Pp
87 The following options are available:
88 .Bl -tag -width ".Fl A"
89 .It Fl -libxo
90 Generate output via
91 .Xr libxo 3
92 in a selection of different human and machine readable formats.
93 See
94 .Xr xo_parse_args 3
95 for details on command line arguments.
96 .It Fl A
97 Add session.
98 .It Fl M
99 Modify session.
100 .It Fl R
101 Remove session.
102 .It Fl L
103 List sessions.
104 .It Fl a
105 When adding, add all sessions defined in the configuration file.
106 When removing, remove all currently established sessions.
107 .It Fl c
108 Path to the configuration file.
109 The default is
110 .Pa /etc/iscsi.conf .
111 .It Fl d
112 Target host name or address used for SendTargets discovery.
113 When used, it will add a temporary discovery session.
114 After discovery is done, sessions will be added for each discovered target,
115 and the temporary discovery session will be removed.
116 .It Fl e
117 Enable or disable the session.
118 This is ignored for discovery sessions, but gets passed down to normal
119 sessions they add.
120 .It Fl i
121 Session ID, as displayed by
122 .Nm
123 .Fl v .
124 .It Fl n
125 The "nickname" of session defined in the configuration file.
126 .It Fl p
127 Target portal - host name or address - for statically defined targets.
128 .It Fl r
129 Use iSER (iSCSI over RDMA) instead of plain iSCSI over TCP/IP.
130 .It Fl s
131 CHAP secret.
132 .It Fl t
133 Target name.
134 .It Fl u
135 CHAP login.
136 .It Fl v
137 Verbose mode.
138 .It Fl w
139 Instead of returning immediately, wait up to
140 .Ar timeout
141 seconds until all configured sessions are successfully established.
142 .El
143 .Pp
144 Certain parameters are necessary when adding a session.
145 One can specify these either via command line (using the
146 .Fl t ,
147 .Fl p ,
148 .Fl u ,
149 and
150 .Fl s
151 options), or configuration file (using the
152 .Fl a
153 or
154 .Fl n
155 options).
156 Some functionality - for example mutual CHAP - is available only
157 via configuration file.
158 .Pp
159 Since connecting to the target is performed in background, non-zero
160 exit status does not mean that the session was successfully established.
161 Use either
162 .Nm Fl L
163 to check the connection status, or the
164 .Fl w
165 flag to wait for session establishment.
166 .Pp
167 Note that in order for the iSCSI initiator to be able to connect to a target,
168 the
169 .Xr iscsid 8
170 daemon must be running.
171 .Pp
172 Also note that
173 .Fx
174 currently supports two different initiators: the old one,
175 .Xr iscsi_initiator 4 ,
176 with its control utility
177 .Xr iscontrol 8 ,
178 and the new one,
179 .Xr iscsi 4 ,
180 with
181 .Nm
182 and
183 .Xr iscsid 8 .
184 The only thing the two have in common is the configuration file,
185 .Xr iscsi.conf 5 .
186 .Sh FILES
187 .Bl -tag -width ".Pa /etc/iscsi.conf" -compact
188 .It Pa /etc/iscsi.conf
189 iSCSI initiator configuration file.
190 .El
191 .Sh EXIT STATUS
192 The
193 .Nm
194 utility exits 0 on success, and >0 if an error occurs.
195 .Sh EXAMPLES
196 Attach to target iqn.2012-06.com.example:target0, served by 192.168.1.1:
197 .Dl Nm Fl A Fl t Ar iqn.2012-06.com.example:target0 Fl p Ar 192.168.1.1
198 .Pp
199 Perform discovery on 192.168.1.1, and add disabled sessions for each
200 discovered target; use
201 .Nm -M -e on
202 to connect them:
203 .Dl Nm Fl A Fl d Ar 192.168.1.1 Fl e Ar off
204 .Pp
205 Disconnect all iSCSI sessions:
206 .Dl Nm Fl Ra
207 .Sh SEE ALSO
208 .Xr libxo 3 ,
209 .Xr xo_parse_args 3 ,
210 .Xr iscsi 4 ,
211 .Xr iscsi.conf 5 ,
212 .Xr iscsid 8
213 .Sh HISTORY
214 The
215 .Nm
216 command appeared in
217 .Fx 10.0 .
218 .Sh AUTHORS
219 The
220 .Nm
221 utility was developed by
222 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
223 under sponsorship from the FreeBSD Foundation.