xref: /freebsd/usr.bin/iscsictl/iscsictl.8 (revision cc61a0793a0e7db8601e5eba1242befb810a5844)
1009ea47eSEdward Tomasz Napierala.\" Copyright (c) 2012 The FreeBSD Foundation
2009ea47eSEdward Tomasz Napierala.\"
3009ea47eSEdward Tomasz Napierala.\" This software was developed by Edward Tomasz Napierala under sponsorship
4009ea47eSEdward Tomasz Napierala.\" from the FreeBSD Foundation.
5009ea47eSEdward Tomasz Napierala.\"
6009ea47eSEdward Tomasz Napierala.\" Redistribution and use in source and binary forms, with or without
7009ea47eSEdward Tomasz Napierala.\" modification, are permitted provided that the following conditions
8009ea47eSEdward Tomasz Napierala.\" are met:
9009ea47eSEdward Tomasz Napierala.\" 1. Redistributions of source code must retain the above copyright
10009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer.
11009ea47eSEdward Tomasz Napierala.\" 2. Redistributions in binary form must reproduce the above copyright
12009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer in the
13009ea47eSEdward Tomasz Napierala.\"    documentation and/or other materials provided with the distribution.
14009ea47eSEdward Tomasz Napierala.\"
15009ea47eSEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16009ea47eSEdward Tomasz Napierala.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17009ea47eSEdward Tomasz Napierala.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18009ea47eSEdward Tomasz Napierala.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19009ea47eSEdward Tomasz Napierala.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20009ea47eSEdward Tomasz Napierala.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21009ea47eSEdward Tomasz Napierala.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22009ea47eSEdward Tomasz Napierala.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23009ea47eSEdward Tomasz Napierala.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24009ea47eSEdward Tomasz Napierala.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25009ea47eSEdward Tomasz Napierala.\" SUCH DAMAGE.
26009ea47eSEdward Tomasz Napierala.\"
27*cc61a079SAlan Somers.Dd July 16, 2025
28009ea47eSEdward Tomasz Napierala.Dt ISCSICTL 8
29009ea47eSEdward Tomasz Napierala.Os
30009ea47eSEdward Tomasz Napierala.Sh NAME
31009ea47eSEdward Tomasz Napierala.Nm iscsictl
32009ea47eSEdward Tomasz Napierala.Nd iSCSI initiator management utility
33009ea47eSEdward Tomasz Napierala.Sh SYNOPSIS
34009ea47eSEdward Tomasz Napierala.Nm
35009ea47eSEdward Tomasz Napierala.Fl A
361dba27c1SEdward Tomasz Napierala.Fl p Ar portal Fl t Ar target
371dba27c1SEdward Tomasz Napierala.Op Fl u Ar user Fl s Ar secret
381dba27c1SEdward Tomasz Napierala.Op Fl w Ar timeout
39b0b3f0e1SEdward Tomasz Napierala.Op Fl r
408ece0ee0SMateusz Piotrowski.Op Fl e Cm on Ns | Ns Cm off
41009ea47eSEdward Tomasz Napierala.Nm
42009ea47eSEdward Tomasz Napierala.Fl A
43b0b3f0e1SEdward Tomasz Napierala.Fl d Ar discovery-host
44b0b3f0e1SEdward Tomasz Napierala.Op Fl u Ar user Fl s Ar secret
45b0b3f0e1SEdward Tomasz Napierala.Op Fl r
468ece0ee0SMateusz Piotrowski.Op Fl e Cm on Ns | Ns Cm off
47009ea47eSEdward Tomasz Napierala.Nm
48009ea47eSEdward Tomasz Napierala.Fl A
49009ea47eSEdward Tomasz Napierala.Fl a Op Fl c Ar path
50009ea47eSEdward Tomasz Napierala.Nm
51009ea47eSEdward Tomasz Napierala.Fl A
52009ea47eSEdward Tomasz Napierala.Fl n Ar nickname Op Fl c Ar path
53009ea47eSEdward Tomasz Napierala.Nm
540262f2e0SEdward Tomasz Napierala.Fl M
550262f2e0SEdward Tomasz Napierala.Fl i Ar session-id
560262f2e0SEdward Tomasz Napierala.Op Fl p Ar portal
570262f2e0SEdward Tomasz Napierala.Op Fl t Ar target
580262f2e0SEdward Tomasz Napierala.Op Fl u Ar user
590262f2e0SEdward Tomasz Napierala.Op Fl s Ar secret
608ece0ee0SMateusz Piotrowski.Op Fl e Cm on Ns | Ns Cm off
610262f2e0SEdward Tomasz Napierala.Nm
620262f2e0SEdward Tomasz Napierala.Fl M
630262f2e0SEdward Tomasz Napierala.Fl i Ar session-id
640262f2e0SEdward Tomasz Napierala.Op Fl n Ar nickname Op Fl c Ar path
650262f2e0SEdward Tomasz Napierala.Nm
66009ea47eSEdward Tomasz Napierala.Fl R
67abec6193SEdward Tomasz Napierala.Op Fl p Ar portal
68009ea47eSEdward Tomasz Napierala.Op Fl t Ar target
69009ea47eSEdward Tomasz Napierala.Nm
70009ea47eSEdward Tomasz Napierala.Fl R
71009ea47eSEdward Tomasz Napierala.Fl a
72009ea47eSEdward Tomasz Napierala.Nm
73009ea47eSEdward Tomasz Napierala.Fl R
74009ea47eSEdward Tomasz Napierala.Fl n Ar nickname Op Fl c Ar path
75009ea47eSEdward Tomasz Napierala.Nm
76009ea47eSEdward Tomasz Napierala.Fl L
77009ea47eSEdward Tomasz Napierala.Op Fl v
781dba27c1SEdward Tomasz Napierala.Op Fl w Ar timeout
79009ea47eSEdward Tomasz Napierala.Sh DESCRIPTION
80009ea47eSEdward Tomasz NapieralaThe
81009ea47eSEdward Tomasz Napierala.Nm
82009ea47eSEdward Tomasz Napieralautility is used to configure the iSCSI initiator.
83009ea47eSEdward Tomasz Napierala.Pp
84009ea47eSEdward Tomasz NapieralaThe following options are available:
858ece0ee0SMateusz Piotrowski.Bl -tag -width "-d discovery-host"
8606691045SCraig Rodrigues.It Fl -libxo
8706691045SCraig RodriguesGenerate output via
8806691045SCraig Rodrigues.Xr libxo 3
8906691045SCraig Rodriguesin a selection of different human and machine readable formats.
9006691045SCraig RodriguesSee
91*cc61a079SAlan Somers.Xr xo_options 7
9206691045SCraig Rodriguesfor details on command line arguments.
93009ea47eSEdward Tomasz Napierala.It Fl A
94009ea47eSEdward Tomasz NapieralaAdd session.
950262f2e0SEdward Tomasz Napierala.It Fl M
960262f2e0SEdward Tomasz NapieralaModify session.
97009ea47eSEdward Tomasz Napierala.It Fl R
98009ea47eSEdward Tomasz NapieralaRemove session.
99009ea47eSEdward Tomasz Napierala.It Fl L
100009ea47eSEdward Tomasz NapieralaList sessions.
101009ea47eSEdward Tomasz Napierala.It Fl a
102009ea47eSEdward Tomasz NapieralaWhen adding, add all sessions defined in the configuration file.
103009ea47eSEdward Tomasz NapieralaWhen removing, remove all currently established sessions.
1048ece0ee0SMateusz Piotrowski.It Fl c Ar path
105009ea47eSEdward Tomasz NapieralaPath to the configuration file.
106009ea47eSEdward Tomasz NapieralaThe default is
107009ea47eSEdward Tomasz Napierala.Pa /etc/iscsi.conf .
1088ece0ee0SMateusz Piotrowski.It Fl d Ar discovery-host
109009ea47eSEdward Tomasz NapieralaTarget host name or address used for SendTargets discovery.
110009ea47eSEdward Tomasz NapieralaWhen used, it will add a temporary discovery session.
111009ea47eSEdward Tomasz NapieralaAfter discovery is done, sessions will be added for each discovered target,
112ee3a0d1cSGavin Atkinsonand the temporary discovery session will be removed.
1138ece0ee0SMateusz Piotrowski.It Fl e Cm on Ns | Ns Cm off
114ba165a31SEdward Tomasz NapieralaEnable or disable the session.
115ba165a31SEdward Tomasz NapieralaThis is ignored for discovery sessions, but gets passed down to normal
116ba165a31SEdward Tomasz Napieralasessions they add.
1178ece0ee0SMateusz Piotrowski.It Fl i Ar session-id
1180262f2e0SEdward Tomasz NapieralaSession ID, as displayed by
1190262f2e0SEdward Tomasz Napierala.Nm
1200262f2e0SEdward Tomasz Napierala.Fl v .
1218ece0ee0SMateusz Piotrowski.It Fl n Ar nickname
1228ece0ee0SMateusz PiotrowskiThe
1238ece0ee0SMateusz Piotrowski.Ar nickname
1248ece0ee0SMateusz Piotrowskiof a session defined in the configuration file.
1258ece0ee0SMateusz Piotrowski.It Fl p Ar portal
1268ece0ee0SMateusz PiotrowskiTarget portal \(em host name or address \(em for statically defined targets.
127b0b3f0e1SEdward Tomasz Napierala.It Fl r
128b0b3f0e1SEdward Tomasz NapieralaUse iSER (iSCSI over RDMA) instead of plain iSCSI over TCP/IP.
1298ece0ee0SMateusz Piotrowski.It Fl s Ar secret
130e3f60bcfSEdward Tomasz NapieralaCHAP secret.
1318ece0ee0SMateusz Piotrowski.It Fl t Ar target
132009ea47eSEdward Tomasz NapieralaTarget name.
1338ece0ee0SMateusz Piotrowski.It Fl u Ar user
134e3f60bcfSEdward Tomasz NapieralaCHAP login.
135009ea47eSEdward Tomasz Napierala.It Fl v
136009ea47eSEdward Tomasz NapieralaVerbose mode.
1378ece0ee0SMateusz Piotrowski.It Fl w Ar timeout
1381dba27c1SEdward Tomasz NapieralaInstead of returning immediately, wait up to
1391dba27c1SEdward Tomasz Napierala.Ar timeout
1401dba27c1SEdward Tomasz Napieralaseconds until all configured sessions are successfully established.
141009ea47eSEdward Tomasz Napierala.El
142009ea47eSEdward Tomasz Napierala.Pp
143ee3a0d1cSGavin AtkinsonCertain parameters are necessary when adding a session.
144bf4427d1SEdward Tomasz NapieralaOne can specify these either via command line (using the
145bf4427d1SEdward Tomasz Napierala.Fl t ,
146bf4427d1SEdward Tomasz Napierala.Fl p ,
147bf4427d1SEdward Tomasz Napierala.Fl u ,
148bf4427d1SEdward Tomasz Napieralaand
149bf4427d1SEdward Tomasz Napierala.Fl s
150bf4427d1SEdward Tomasz Napieralaoptions), or configuration file (using the
151bf4427d1SEdward Tomasz Napierala.Fl a
152bf4427d1SEdward Tomasz Napieralaor
153bf4427d1SEdward Tomasz Napierala.Fl n
154bf4427d1SEdward Tomasz Napieralaoptions).
155bf4427d1SEdward Tomasz NapieralaSome functionality - for example mutual CHAP - is available only
156bf4427d1SEdward Tomasz Napieralavia configuration file.
157bf4427d1SEdward Tomasz Napierala.Pp
158009ea47eSEdward Tomasz NapieralaSince connecting to the target is performed in background, non-zero
159009ea47eSEdward Tomasz Napieralaexit status does not mean that the session was successfully established.
1601dba27c1SEdward Tomasz NapieralaUse either
161009ea47eSEdward Tomasz Napierala.Nm Fl L
1621dba27c1SEdward Tomasz Napieralato check the connection status, or the
1631dba27c1SEdward Tomasz Napierala.Fl w
1641dba27c1SEdward Tomasz Napieralaflag to wait for session establishment.
165009ea47eSEdward Tomasz Napierala.Pp
1660151d866SEdward Tomasz NapieralaNote that in order for the iSCSI initiator to be able to connect to a target,
167009ea47eSEdward Tomasz Napieralathe
168009ea47eSEdward Tomasz Napierala.Xr iscsid 8
169009ea47eSEdward Tomasz Napieraladaemon must be running.
170009ea47eSEdward Tomasz Napierala.Sh FILES
171009ea47eSEdward Tomasz Napierala.Bl -tag -width ".Pa /etc/iscsi.conf" -compact
172009ea47eSEdward Tomasz Napierala.It Pa /etc/iscsi.conf
173009ea47eSEdward Tomasz NapieralaiSCSI initiator configuration file.
174009ea47eSEdward Tomasz Napierala.El
175009ea47eSEdward Tomasz Napierala.Sh EXIT STATUS
176009ea47eSEdward Tomasz NapieralaThe
177009ea47eSEdward Tomasz Napierala.Nm
178009ea47eSEdward Tomasz Napieralautility exits 0 on success, and >0 if an error occurs.
179009ea47eSEdward Tomasz Napierala.Sh EXAMPLES
1803b6eb6baSEdward Tomasz NapieralaAttach to target iqn.2012-06.com.example:target0, served by 192.168.1.1:
1813b6eb6baSEdward Tomasz Napierala.Dl Nm Fl A Fl t Ar iqn.2012-06.com.example:target0 Fl p Ar 192.168.1.1
182009ea47eSEdward Tomasz Napierala.Pp
183ba165a31SEdward Tomasz NapieralaPerform discovery on 192.168.1.1, and add disabled sessions for each
184ba165a31SEdward Tomasz Napieraladiscovered target; use
185ba165a31SEdward Tomasz Napierala.Nm -M -e on
186ba165a31SEdward Tomasz Napieralato connect them:
187ba165a31SEdward Tomasz Napierala.Dl Nm Fl A Fl d Ar 192.168.1.1 Fl e Ar off
188ba165a31SEdward Tomasz Napierala.Pp
189009ea47eSEdward Tomasz NapieralaDisconnect all iSCSI sessions:
190009ea47eSEdward Tomasz Napierala.Dl Nm Fl Ra
191009ea47eSEdward Tomasz Napierala.Sh SEE ALSO
1925837aafdSJoel Dahl.Xr libxo 3 ,
193*cc61a079SAlan Somers.Xr xo_options 7 ,
1944f9ec027SAllan Jude.Xr iscsi 4 ,
19533e1779aSJoel Dahl.Xr iscsi.conf 5 ,
1965837aafdSJoel Dahl.Xr iscsid 8
197009ea47eSEdward Tomasz Napierala.Sh HISTORY
198009ea47eSEdward Tomasz NapieralaThe
199009ea47eSEdward Tomasz Napierala.Nm
200009ea47eSEdward Tomasz Napieralacommand appeared in
201009ea47eSEdward Tomasz Napierala.Fx 10.0 .
202009ea47eSEdward Tomasz Napierala.Sh AUTHORS
203009ea47eSEdward Tomasz NapieralaThe
204009ea47eSEdward Tomasz Napierala.Nm
2054f9ec027SAllan Judeutility was developed by
2062b7af31cSBaptiste Daroussin.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
207009ea47eSEdward Tomasz Napieralaunder sponsorship from the FreeBSD Foundation.
208