xref: /freebsd/usr.bin/iscsictl/iscsictl.8 (revision 6d732c66bca5da4d261577aad2c8ea84519b0bea)
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 January 4, 2014
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 Op Fl u Ar user Fl s Ar secret
40.Nm
41.Fl A
42.Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret
43.Nm
44.Fl A
45.Fl a Op Fl c Ar path
46.Nm
47.Fl A
48.Fl n Ar nickname Op Fl c Ar path
49.Nm
50.Fl R
51.Op Fl p Ar portal
52.Op Fl t Ar target
53.Nm
54.Fl R
55.Fl a
56.Nm
57.Fl R
58.Fl n Ar nickname Op Fl c Ar path
59.Nm
60.Fl L
61.Op Fl v
62.Sh DESCRIPTION
63The
64.Nm
65utility is used to configure the iSCSI initiator.
66.Pp
67The following options are available:
68.Bl -tag -width ".Fl A"
69.It Fl A
70Add session.
71.It Fl R
72Remove session.
73.It Fl L
74List sessions.
75.It Fl a
76When adding, add all sessions defined in the configuration file.
77When removing, remove all currently established sessions.
78.It Fl c
79Path to the configuration file.
80The default is
81.Pa /etc/iscsi.conf .
82.It Fl d
83Target host name or address used for SendTargets discovery.
84When used, it will add a temporary discovery session.
85After discovery is done, sessions will be added for each discovered target,
86and the temporary discovery sesion will be removed.
87.It Fl n
88The "nickname" of session defined in the configuration file.
89.It Fl p
90Target portal - host name or address - for statically defined targets.
91.It Fl s
92CHAP secret.
93.It Fl t
94Target name.
95.It Fl u
96CHAP login.
97.It Fl v
98Verbose mode.
99.El
100.Pp
101Since connecting to the target is performed in background, non-zero
102exit status does not mean that the session was successfully established.
103Use
104.Nm Fl L
105to check the connection status.
106.Pp
107Note that in order to the iSCSI initiator to be able to connect to a target,
108the
109.Xr iscsid 8
110daemon must be running.
111.Pp
112Also note that
113.Fx
114currently supports two different initiators: the old one,
115.Xr iscsi_initiator 4 ,
116with its control utility
117.Xr iscontrol 8 ,
118and the new one,
119.Xr iscsi 4 ,
120with
121.Nm
122and
123.Xr iscsid 8 .
124The only thing the two have in common is the configuration file,
125.Xr iscsi.conf 5 .
126.Sh FILES
127.Bl -tag -width ".Pa /etc/iscsi.conf" -compact
128.It Pa /etc/iscsi.conf
129iSCSI initiator configuration file.
130.El
131.Sh EXIT STATUS
132The
133.Nm
134utility exits 0 on success, and >0 if an error occurs.
135.Sh EXAMPLES
136Attach to target iqn.2012-06.com.example:target0, served by 192.168.1.1:
137.Dl Nm Fl A Fl t Ar iqn.2012-06.com.example:target0 Fl p Ar 192.168.1.1
138.Pp
139Disconnect all iSCSI sessions:
140.Dl Nm Fl Ra
141.Sh SEE ALSO
142.Xr iscsi.conf 5 ,
143.Xr iscsid 8
144.Sh HISTORY
145The
146.Nm
147command appeared in
148.Fx 10.0 .
149.Sh AUTHORS
150The
151.Nm
152was developed by
153.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
154under sponsorship from the FreeBSD Foundation.
155