xref: /freebsd/usr.bin/iscsictl/iscsictl.8 (revision 4f0a4502a1f33fef287ac558c98e5ef99a32216f)
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 December 1, 2015
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.Nm
43.Fl A
44.Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret
45.Nm
46.Fl A
47.Fl a Op Fl c Ar path
48.Nm
49.Fl A
50.Fl n Ar nickname Op Fl c Ar path
51.Nm
52.Fl M
53.Fl i Ar session-id
54.Op Fl p Ar portal
55.Op Fl t Ar target
56.Op Fl u Ar user
57.Op Fl s Ar secret
58.Nm
59.Fl M
60.Fl i Ar session-id
61.Op Fl n Ar nickname Op Fl c Ar path
62.Nm
63.Fl R
64.Op Fl p Ar portal
65.Op Fl t Ar target
66.Nm
67.Fl R
68.Fl a
69.Nm
70.Fl R
71.Fl n Ar nickname Op Fl c Ar path
72.Nm
73.Fl L
74.Op Fl v
75.Op Fl w Ar timeout
76.Sh DESCRIPTION
77The
78.Nm
79utility is used to configure the iSCSI initiator.
80.Pp
81The following options are available:
82.Bl -tag -width ".Fl A"
83.It Fl -libxo
84Generate output via
85.Xr libxo 3
86in a selection of different human and machine readable formats.
87See
88.Xr xo_parse_args 3
89for details on command line arguments.
90.It Fl A
91Add session.
92.It Fl M
93Modify session.
94.It Fl R
95Remove session.
96.It Fl L
97List sessions.
98.It Fl a
99When adding, add all sessions defined in the configuration file.
100When removing, remove all currently established sessions.
101.It Fl c
102Path to the configuration file.
103The default is
104.Pa /etc/iscsi.conf .
105.It Fl d
106Target host name or address used for SendTargets discovery.
107When used, it will add a temporary discovery session.
108After discovery is done, sessions will be added for each discovered target,
109and the temporary discovery session will be removed.
110.It Fl i
111Session ID, as displayed by
112.Nm
113.Fl v .
114.It Fl n
115The "nickname" of session defined in the configuration file.
116.It Fl p
117Target portal - host name or address - for statically defined targets.
118.It Fl s
119CHAP secret.
120.It Fl t
121Target name.
122.It Fl u
123CHAP login.
124.It Fl v
125Verbose mode.
126.It Fl w
127Instead of returning immediately, wait up to
128.Ar timeout
129seconds until all configured sessions are successfully established.
130.El
131.Pp
132Certain parameters are necessary when adding a session.
133One can specify these either via command line (using the
134.Fl t ,
135.Fl p ,
136.Fl u ,
137and
138.Fl s
139options), or configuration file (using the
140.Fl a
141or
142.Fl n
143options).
144Some functionality - for example mutual CHAP - is available only
145via configuration file.
146.Pp
147Since connecting to the target is performed in background, non-zero
148exit status does not mean that the session was successfully established.
149Use either
150.Nm Fl L
151to check the connection status, or the
152.Fl w
153flag to wait for session establishment.
154.Pp
155Note that in order for the iSCSI initiator to be able to connect to a target,
156the
157.Xr iscsid 8
158daemon must be running.
159.Pp
160Also note that
161.Fx
162currently supports two different initiators: the old one,
163.Xr iscsi_initiator 4 ,
164with its control utility
165.Xr iscontrol 8 ,
166and the new one,
167.Xr iscsi 4 ,
168with
169.Nm
170and
171.Xr iscsid 8 .
172The only thing the two have in common is the configuration file,
173.Xr iscsi.conf 5 .
174.Sh FILES
175.Bl -tag -width ".Pa /etc/iscsi.conf" -compact
176.It Pa /etc/iscsi.conf
177iSCSI initiator configuration file.
178.El
179.Sh EXIT STATUS
180The
181.Nm
182utility exits 0 on success, and >0 if an error occurs.
183.Sh EXAMPLES
184Attach to target iqn.2012-06.com.example:target0, served by 192.168.1.1:
185.Dl Nm Fl A Fl t Ar iqn.2012-06.com.example:target0 Fl p Ar 192.168.1.1
186.Pp
187Disconnect all iSCSI sessions:
188.Dl Nm Fl Ra
189.Sh SEE ALSO
190.Xr libxo 3 ,
191.Xr xo_parse_args 3 ,
192.Xr iscsi 4 ,
193.Xr iscsi.conf 5 ,
194.Xr iscsid 8
195.Sh HISTORY
196The
197.Nm
198command appeared in
199.Fx 10.0 .
200.Sh AUTHORS
201The
202.Nm
203utility was developed by
204.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
205under sponsorship from the FreeBSD Foundation.
206