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