2013-09-14 15:29:06 +00:00
|
|
|
.\" Copyright (c) 2012 The FreeBSD Foundation
|
2015-09-07 13:43:05 +00:00
|
|
|
.\" Copyright (c) 2015 Alexander Motin <mav@FreeBSD.org>
|
2013-09-14 15:29:06 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This software was developed by Edward Tomasz Napierala under sponsorship
|
|
|
|
.\" from the FreeBSD Foundation.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2016-07-21 08:22:25 +00:00
|
|
|
.Dd July 21, 2016
|
2013-09-14 15:29:06 +00:00
|
|
|
.Dt CTL.CONF 5
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ctl.conf
|
|
|
|
.Nd CAM Target Layer / iSCSI target daemon configuration file
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
configuration file is used by the
|
|
|
|
.Xr ctld 8
|
|
|
|
daemon.
|
|
|
|
Lines starting with
|
|
|
|
.Ql #
|
2014-04-24 11:28:23 +00:00
|
|
|
are interpreted as comments.
|
2013-09-14 15:29:06 +00:00
|
|
|
The general syntax of the
|
|
|
|
.Nm
|
|
|
|
file is:
|
|
|
|
.Bd -literal -offset indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.No pidfile Ar path
|
2013-09-14 15:29:06 +00:00
|
|
|
|
2014-09-12 00:08:19 +00:00
|
|
|
.No auth-group Ar name No {
|
|
|
|
.Dl chap Ar user Ar secret
|
|
|
|
.Dl ...
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
|
2014-09-12 00:08:19 +00:00
|
|
|
.No portal-group Ar name No {
|
|
|
|
.Dl listen Ar address
|
2014-10-22 11:06:05 +00:00
|
|
|
.\".Dl listen-iser Ar address
|
2014-09-12 00:08:19 +00:00
|
|
|
.Dl discovery-auth-group Ar name
|
|
|
|
.Dl ...
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
|
2014-09-12 00:08:19 +00:00
|
|
|
.No target Ar name {
|
|
|
|
.Dl auth-group Ar name
|
2015-09-03 11:42:59 +00:00
|
|
|
.Dl portal-group Ar name
|
2014-09-12 00:08:19 +00:00
|
|
|
.Dl lun Ar number No {
|
|
|
|
.Dl path Ar path
|
|
|
|
.Dl }
|
|
|
|
.Dl ...
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
.Ed
|
2014-09-12 00:08:19 +00:00
|
|
|
.Ss Global Context
|
2013-09-14 15:29:06 +00:00
|
|
|
.Bl -tag -width indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic auth-group Ar name
|
|
|
|
Create an
|
|
|
|
.Sy auth-group
|
|
|
|
configuration context,
|
2014-09-13 23:50:51 +00:00
|
|
|
defining a new auth-group,
|
2013-09-14 15:29:06 +00:00
|
|
|
which can then be assigned to any number of targets.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic debug Ar level
|
|
|
|
The debug verbosity level.
|
2013-09-14 15:29:06 +00:00
|
|
|
The default is 0.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic maxproc Ar number
|
|
|
|
The limit for concurrently running child processes handling
|
2013-09-14 15:29:06 +00:00
|
|
|
incoming connections.
|
|
|
|
The default is 30.
|
2014-09-12 00:08:19 +00:00
|
|
|
A setting of 0 disables the limit.
|
|
|
|
.It Ic pidfile Ar path
|
|
|
|
The path to the pidfile.
|
2013-09-14 15:29:06 +00:00
|
|
|
The default is
|
|
|
|
.Pa /var/run/ctld.pid .
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic portal-group Ar name
|
|
|
|
Create a
|
|
|
|
.Sy portal-group
|
|
|
|
configuration context,
|
2014-09-14 08:35:44 +00:00
|
|
|
defining a new portal-group,
|
2013-09-14 15:29:06 +00:00
|
|
|
which can then be assigned to any number of targets.
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
.It Ic lun Ar name
|
|
|
|
Create a
|
|
|
|
.Sy lun
|
2015-08-24 09:33:12 +00:00
|
|
|
configuration context, defining a LUN to be exported by any number of targets.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic target Ar name
|
|
|
|
Create a
|
|
|
|
.Sy target
|
2015-08-24 09:33:12 +00:00
|
|
|
configuration context, which can optionally contain one or more
|
2014-09-12 00:08:19 +00:00
|
|
|
.Sy lun
|
|
|
|
contexts.
|
|
|
|
.It Ic timeout Ar seconds
|
|
|
|
The timeout for login sessions, after which the connection
|
2013-09-14 15:29:06 +00:00
|
|
|
will be forcibly terminated.
|
|
|
|
The default is 60.
|
2014-09-12 00:08:19 +00:00
|
|
|
A setting of 0 disables the timeout.
|
2014-10-25 12:50:26 +00:00
|
|
|
.It Ic isns-server Ar address
|
|
|
|
An IPv4 or IPv6 address and optionally port of iSNS server to register on.
|
|
|
|
.It Ic isns-period Ar seconds
|
|
|
|
iSNS registration period.
|
|
|
|
Registered Network Entity not updated during this period will be unregistered.
|
2014-10-28 17:11:51 +00:00
|
|
|
The default is 900.
|
2014-10-25 12:50:26 +00:00
|
|
|
.It Ic isns-timeout Ar seconds
|
|
|
|
Timeout for iSNS requests.
|
2014-10-28 17:11:51 +00:00
|
|
|
The default is 5.
|
2013-09-14 15:29:06 +00:00
|
|
|
.El
|
2014-09-12 00:08:19 +00:00
|
|
|
.Ss auth-group Context
|
2013-09-14 15:29:06 +00:00
|
|
|
.Bl -tag -width indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic auth-type Ar type
|
|
|
|
Sets the authentication type.
|
|
|
|
Type can be either
|
|
|
|
.Qq Ar none ,
|
|
|
|
.Qq Ar deny ,
|
|
|
|
.Qq Ar chap ,
|
|
|
|
or
|
|
|
|
.Qq Ar chap-mutual .
|
2014-07-20 22:13:51 +00:00
|
|
|
In most cases it is not necessary to set the type using this clause;
|
2014-09-12 00:08:19 +00:00
|
|
|
it is usually used to disable authentication for a given
|
|
|
|
.Sy auth-group .
|
|
|
|
.It Ic chap Ar user Ar secret
|
|
|
|
A set of CHAP authentication credentials.
|
|
|
|
Note that for any
|
|
|
|
.Sy auth-group ,
|
|
|
|
the configuration may only contain either
|
|
|
|
.Sy chap
|
|
|
|
or
|
|
|
|
.Sy chap-mutual
|
|
|
|
entries; it is an error to mix them.
|
|
|
|
.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret
|
|
|
|
A set of mutual CHAP authentication credentials.
|
|
|
|
Note that for any
|
|
|
|
.Sy auth-group ,
|
|
|
|
the configuration may only contain either
|
|
|
|
.Sy chap
|
|
|
|
or
|
|
|
|
.Sy chap-mutual
|
|
|
|
entries; it is an error to mix them.
|
|
|
|
.It Ic initiator-name Ar initiator-name
|
|
|
|
An iSCSI initiator name.
|
|
|
|
Only initiators with a name matching one of the defined
|
|
|
|
names will be allowed to connect.
|
2014-02-11 11:08:04 +00:00
|
|
|
If not defined, there will be no restrictions based on initiator
|
|
|
|
name.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen
|
|
|
|
An iSCSI initiator portal: an IPv4 or IPv6 address, optionally
|
|
|
|
followed by a literal slash and a prefix length.
|
|
|
|
Only initiators with an address matching one of the defined
|
|
|
|
addresses will be allowed to connect.
|
2014-02-11 11:08:04 +00:00
|
|
|
If not defined, there will be no restrictions based on initiator
|
|
|
|
address.
|
2013-09-14 15:29:06 +00:00
|
|
|
.El
|
2014-09-12 00:08:19 +00:00
|
|
|
.Ss portal-group Context
|
2013-09-14 15:29:06 +00:00
|
|
|
.Bl -tag -width indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic discovery-auth-group Ar name
|
|
|
|
Assign a previously defined authentication group to the portal group,
|
2013-09-14 15:29:06 +00:00
|
|
|
to be used for target discovery.
|
2014-10-22 11:09:03 +00:00
|
|
|
By default, portal groups are assigned predefined
|
2014-09-12 00:08:19 +00:00
|
|
|
.Sy auth-group
|
|
|
|
.Qq Ar default ,
|
|
|
|
which denies discovery.
|
|
|
|
Another predefined
|
|
|
|
.Sy auth-group ,
|
|
|
|
.Qq Ar no-authentication ,
|
|
|
|
may be used
|
2014-02-11 11:31:08 +00:00
|
|
|
to permit discovery without authentication.
|
2014-10-29 09:26:55 +00:00
|
|
|
.It Ic discovery-filter Ar filter
|
|
|
|
Determines which targets are returned during discovery.
|
|
|
|
Filter can be either
|
|
|
|
.Qq Ar none ,
|
|
|
|
.Qq Ar portal ,
|
|
|
|
.Qq Ar portal-name ,
|
|
|
|
or
|
|
|
|
.Qq Ar portal-name-auth .
|
|
|
|
When set to
|
|
|
|
.Qq Ar none ,
|
|
|
|
discovery will return all targets assigned to that portal group.
|
|
|
|
When set to
|
|
|
|
.Qq Ar portal ,
|
|
|
|
discovery will not return targets that cannot be accessed by the
|
|
|
|
initiator because of their
|
|
|
|
.Sy initiator-portal .
|
|
|
|
When set to
|
|
|
|
.Qq Ar portal-name ,
|
|
|
|
the check will include both
|
|
|
|
.Sy initiator-portal
|
|
|
|
and
|
|
|
|
.Sy initiator-name .
|
|
|
|
When set to
|
|
|
|
.Qq Ar portal-name-auth ,
|
|
|
|
the check will include
|
|
|
|
.Sy initiator-portal ,
|
|
|
|
.Sy initiator-name ,
|
2014-11-08 07:54:34 +00:00
|
|
|
and authentication credentials.
|
|
|
|
The target is returned if it does not require CHAP authentication,
|
|
|
|
or if the CHAP user and secret used during discovery match those
|
|
|
|
used by the target.
|
2014-10-29 09:26:55 +00:00
|
|
|
Note that when using
|
|
|
|
.Qq Ar portal-name-auth ,
|
|
|
|
targets that require CHAP authentication will only be returned if
|
|
|
|
.Sy discovery-auth-group
|
|
|
|
requires CHAP.
|
|
|
|
The default is
|
|
|
|
.Qq Ar none .
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic listen Ar address
|
|
|
|
An IPv4 or IPv6 address and port to listen on for incoming connections.
|
2014-10-22 11:06:05 +00:00
|
|
|
.\".It Ic listen-iser Ar address
|
|
|
|
.\"An IPv4 or IPv6 address and port to listen on for incoming connections
|
|
|
|
.\"using iSER (iSCSI over RDMA) protocol.
|
2015-02-28 12:02:32 +00:00
|
|
|
.It Ic offload Ar driver
|
|
|
|
Define iSCSI hardware offload driver to use for this
|
|
|
|
.Sy portal-group .
|
2016-06-01 11:45:06 +00:00
|
|
|
The default is
|
|
|
|
.Qq Ar none .
|
2015-11-09 18:33:36 +00:00
|
|
|
.It Ic option Ar name Ar value
|
|
|
|
The CTL-specific port options passed to the kernel.
|
2015-02-11 17:00:32 +00:00
|
|
|
.It Ic redirect Ar address
|
2014-11-09 13:01:09 +00:00
|
|
|
IPv4 or IPv6 address to redirect initiators to.
|
|
|
|
When configured, all initiators attempting to connect to portal
|
|
|
|
belonging to this
|
|
|
|
.Sy portal-group
|
|
|
|
will get redirected using "Target moved temporarily" login response.
|
|
|
|
Redirection happens before authentication and any
|
|
|
|
.Sy initiator-name
|
|
|
|
or
|
|
|
|
.Sy initiator-portal
|
|
|
|
checks are skipped.
|
2015-09-07 13:43:05 +00:00
|
|
|
.It Ic tag Ar value
|
|
|
|
Unique 16-bit tag value of this
|
|
|
|
.Sy portal-group .
|
|
|
|
If not specified, the value is generated automatically.
|
|
|
|
.It Ic foreign
|
|
|
|
Specifies that this
|
|
|
|
.Sy portal-group
|
|
|
|
is listened by some other host.
|
|
|
|
This host will announce it on discovery stage, but won't listen.
|
2013-09-14 15:29:06 +00:00
|
|
|
.El
|
2014-09-12 00:08:19 +00:00
|
|
|
.Ss target Context
|
2013-09-14 15:29:06 +00:00
|
|
|
.Bl -tag -width indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic alias Ar text
|
|
|
|
Assign a human-readable description to the target.
|
2013-09-14 15:29:06 +00:00
|
|
|
There is no default.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic auth-group Ar name
|
|
|
|
Assign a previously defined authentication group to the target.
|
2014-02-11 11:29:58 +00:00
|
|
|
By default, targets that do not specify their own auth settings,
|
2014-09-12 00:08:19 +00:00
|
|
|
using clauses such as
|
|
|
|
.Sy chap
|
|
|
|
or
|
2014-09-12 00:55:42 +00:00
|
|
|
.Sy initiator-name ,
|
2014-09-12 00:08:19 +00:00
|
|
|
are assigned
|
|
|
|
predefined
|
|
|
|
.Sy auth-group
|
|
|
|
.Qq Ar default ,
|
|
|
|
which denies all access.
|
|
|
|
Another predefined
|
|
|
|
.Sy auth-group ,
|
|
|
|
.Qq Ar no-authentication ,
|
|
|
|
may be used to permit access
|
2013-09-14 15:29:06 +00:00
|
|
|
without authentication.
|
2015-08-24 09:33:12 +00:00
|
|
|
Note that this clause can be overridden using the second argument
|
|
|
|
to a
|
|
|
|
.Sy portal-group
|
|
|
|
clause.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic auth-type Ar type
|
|
|
|
Sets the authentication type.
|
|
|
|
Type can be either
|
|
|
|
.Qq Ar none ,
|
|
|
|
.Qq Ar deny ,
|
|
|
|
.Qq Ar chap ,
|
|
|
|
or
|
|
|
|
.Qq Ar chap-mutual .
|
2014-07-20 22:13:51 +00:00
|
|
|
In most cases it is not necessary to set the type using this clause;
|
2014-09-12 00:08:19 +00:00
|
|
|
it is usually used to disable authentication for a given
|
|
|
|
.Sy target .
|
|
|
|
This clause is mutually exclusive with
|
|
|
|
.Sy auth-group ;
|
|
|
|
one cannot use
|
2014-02-11 11:26:05 +00:00
|
|
|
both in a single target.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic chap Ar user Ar secret
|
|
|
|
A set of CHAP authentication credentials.
|
|
|
|
Note that targets must only use one of
|
|
|
|
.Sy auth-group , chap , No or Sy chap-mutual ;
|
|
|
|
it is a configuration error to mix multiple types in one target.
|
|
|
|
.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret
|
|
|
|
A set of mutual CHAP authentication credentials.
|
|
|
|
Note that targets must only use one of
|
|
|
|
.Sy auth-group , chap , No or Sy chap-mutual ;
|
|
|
|
it is a configuration error to mix multiple types in one target.
|
|
|
|
.It Ic initiator-name Ar initiator-name
|
|
|
|
An iSCSI initiator name.
|
|
|
|
Only initiators with a name matching one of the defined
|
|
|
|
names will be allowed to connect.
|
2014-02-11 11:08:04 +00:00
|
|
|
If not defined, there will be no restrictions based on initiator
|
|
|
|
name.
|
2014-09-12 00:08:19 +00:00
|
|
|
This clause is mutually exclusive with
|
|
|
|
.Sy auth-group ;
|
|
|
|
one cannot use
|
2014-02-11 11:08:04 +00:00
|
|
|
both in a single target.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen
|
|
|
|
An iSCSI initiator portal: an IPv4 or IPv6 address, optionally
|
|
|
|
followed by a literal slash and a prefix length.
|
|
|
|
Only initiators with an address matching one of the defined
|
|
|
|
addresses will be allowed to connect.
|
2014-02-11 11:08:04 +00:00
|
|
|
If not defined, there will be no restrictions based on initiator
|
|
|
|
address.
|
2014-09-12 00:08:19 +00:00
|
|
|
This clause is mutually exclusive with
|
|
|
|
.Sy auth-group ;
|
|
|
|
one cannot use
|
2014-02-11 11:08:04 +00:00
|
|
|
both in a single target.
|
2015-08-24 09:33:12 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Sy auth-type ,
|
|
|
|
.Sy chap ,
|
|
|
|
.Sy chap-mutual ,
|
|
|
|
.Sy initiator-name ,
|
|
|
|
and
|
|
|
|
.Sy initiator-portal
|
|
|
|
clauses in the target context provide an alternative to assigning an
|
|
|
|
.Sy auth-group
|
|
|
|
defined separately, useful in the common case of authentication settings
|
|
|
|
specific to a single target.
|
|
|
|
.It Ic portal-group Ar name Op Ar ag-name
|
2014-09-12 00:08:19 +00:00
|
|
|
Assign a previously defined portal group to the target.
|
|
|
|
The default portal group is
|
|
|
|
.Qq Ar default ,
|
|
|
|
which makes the target available
|
2013-09-14 15:29:06 +00:00
|
|
|
on TCP port 3260 on all configured IPv4 and IPv6 addresses.
|
2015-08-24 09:33:12 +00:00
|
|
|
Optional second argument specifies
|
|
|
|
.Sy auth-group
|
|
|
|
for connections to this specific portal group.
|
|
|
|
If second argument is not specified, target
|
|
|
|
.Sy auth-group
|
|
|
|
is used.
|
2015-02-07 13:19:04 +00:00
|
|
|
.It Ic port Ar name
|
2015-06-24 15:13:27 +00:00
|
|
|
.It Ic port Ar name/pp
|
|
|
|
.It Ic port Ar name/pp/vp
|
|
|
|
Assign specified CTL port (such as "isp0" or "isp2/1") to the target.
|
2015-08-24 09:33:12 +00:00
|
|
|
This is used to export the target through a specific physical - eg Fibre
|
|
|
|
Channel - port, in addition to portal-groups configured for the target.
|
|
|
|
Use
|
|
|
|
.Cm "ctladm portlist"
|
|
|
|
command to retrieve the list of available ports.
|
|
|
|
On startup
|
|
|
|
.Xr ctld 8
|
|
|
|
configures LUN mapping and enables all assigned ports.
|
2015-02-07 13:19:04 +00:00
|
|
|
Each port can be assigned to only one target.
|
2015-02-11 17:00:32 +00:00
|
|
|
.It Ic redirect Ar address
|
2014-11-09 13:01:09 +00:00
|
|
|
IPv4 or IPv6 address to redirect initiators to.
|
|
|
|
When configured, all initiators attempting to connect to this target
|
|
|
|
will get redirected using "Target moved temporarily" login response.
|
|
|
|
Redirection happens after successful authentication.
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
.It Ic lun Ar number Ar name
|
|
|
|
Export previously defined
|
|
|
|
.Sy lun
|
|
|
|
by the parent target.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic lun Ar number
|
|
|
|
Create a
|
|
|
|
.Sy lun
|
|
|
|
configuration context, defining a LUN exported by the parent target.
|
2015-08-24 09:33:12 +00:00
|
|
|
.Pp
|
|
|
|
This is an alternative to defining the LUN separately, useful in the common
|
|
|
|
case of a LUN being exported by a single target.
|
2013-09-14 15:29:06 +00:00
|
|
|
.El
|
2014-09-12 00:08:19 +00:00
|
|
|
.Ss lun Context
|
2013-09-14 15:29:06 +00:00
|
|
|
.Bl -tag -width indent
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic backend Ar block No | Ar ramdisk
|
|
|
|
The CTL backend to use for a given LUN.
|
2013-09-14 15:29:06 +00:00
|
|
|
Valid choices are
|
2014-09-12 00:08:19 +00:00
|
|
|
.Qq Ar block
|
2013-09-14 15:29:06 +00:00
|
|
|
and
|
2014-09-12 00:08:19 +00:00
|
|
|
.Qq Ar ramdisk ;
|
2013-09-14 15:29:06 +00:00
|
|
|
block is used for LUNs backed
|
2014-04-24 11:28:23 +00:00
|
|
|
by files or disk device nodes; ramdisk is a bitsink device, used mostly for
|
2013-09-14 15:29:06 +00:00
|
|
|
testing.
|
|
|
|
The default backend is block.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic blocksize Ar size
|
|
|
|
The blocksize visible to the initiator.
|
2015-10-02 11:27:34 +00:00
|
|
|
The default blocksize is 512 for disks, and 2048 for CD/DVDs.
|
2015-09-15 13:37:48 +00:00
|
|
|
.It Ic ctl-lun Ar lun_id
|
|
|
|
Global numeric identifier to use for a given LUN inside CTL.
|
|
|
|
By default CTL allocates those IDs dynamically, but explicit specification
|
|
|
|
may be needed for consistency in HA configurations.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic device-id Ar string
|
|
|
|
The SCSI Device Identification string presented to the initiator.
|
2015-09-27 13:47:28 +00:00
|
|
|
.It Ic device-type Ar type
|
|
|
|
Specify the SCSI device type to use when creating the LUN.
|
|
|
|
Currently CTL supports Direct Access (type 0), Processor (type 3)
|
|
|
|
and CD/DVD (type 5) LUNs.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic option Ar name Ar value
|
|
|
|
The CTL-specific options passed to the kernel.
|
|
|
|
All CTL-specific options are documented in the
|
|
|
|
.Sx OPTIONS
|
|
|
|
section of
|
2014-09-14 08:35:44 +00:00
|
|
|
.Xr ctladm 8 .
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic path Ar path
|
2015-04-21 09:11:28 +00:00
|
|
|
The path to the file, device node, or
|
|
|
|
.Xr zfs 8
|
|
|
|
volume used to back the LUN.
|
|
|
|
For optimal performance, create the volume with the
|
|
|
|
.Qq Ar volmode=dev
|
|
|
|
property set.
|
2014-09-12 00:08:19 +00:00
|
|
|
.It Ic serial Ar string
|
|
|
|
The SCSI serial number presented to the initiator.
|
|
|
|
.It Ic size Ar size
|
|
|
|
The LUN size, in bytes.
|
2013-09-14 15:29:06 +00:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width ".Pa /etc/ctl.conf" -compact
|
|
|
|
.It Pa /etc/ctl.conf
|
|
|
|
The default location of the
|
|
|
|
.Xr ctld 8
|
|
|
|
configuration file.
|
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
|
|
|
.Bd -literal
|
2014-10-24 12:30:43 +00:00
|
|
|
auth-group ag0 {
|
2013-09-14 15:29:06 +00:00
|
|
|
chap-mutual "user" "secret" "mutualuser" "mutualsecret"
|
|
|
|
chap-mutual "user2" "secret2" "mutualuser" "mutualsecret"
|
2014-09-05 14:58:24 +00:00
|
|
|
initiator-portal 192.168.1.1/16
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
|
2014-10-24 12:30:43 +00:00
|
|
|
auth-group ag1 {
|
|
|
|
auth-type none
|
|
|
|
initiator-name "iqn.2012-06.com.example:initiatorhost1"
|
|
|
|
initiator-name "iqn.2012-06.com.example:initiatorhost2"
|
|
|
|
initiator-portal 192.168.1.1/24
|
|
|
|
initiator-portal [2001:db8::de:ef]
|
|
|
|
}
|
|
|
|
|
|
|
|
portal-group pg0 {
|
2013-09-14 15:29:06 +00:00
|
|
|
discovery-auth-group no-authentication
|
2014-10-24 12:30:43 +00:00
|
|
|
listen 0.0.0.0:3260
|
|
|
|
listen [::]:3260
|
|
|
|
listen [fe80::be:ef]:3261
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
target iqn.2012-06.com.example:target0 {
|
2014-04-24 11:28:23 +00:00
|
|
|
alias "Example target"
|
2013-09-14 15:29:06 +00:00
|
|
|
auth-group no-authentication
|
|
|
|
lun 0 {
|
2014-10-22 11:30:56 +00:00
|
|
|
path /dev/zvol/tank/example_0
|
2013-09-14 15:29:06 +00:00
|
|
|
blocksize 4096
|
|
|
|
size 4G
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
lun example_1 {
|
|
|
|
path /dev/zvol/tank/example_1
|
2015-03-04 14:30:09 +00:00
|
|
|
option naa 0x50015178f369f093
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
}
|
|
|
|
|
2014-10-24 12:30:43 +00:00
|
|
|
target iqn.2012-06.com.example:target1 {
|
|
|
|
auth-group ag0
|
|
|
|
portal-group pg0
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
lun 0 example_1
|
2013-09-14 15:29:06 +00:00
|
|
|
lun 1 {
|
CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports. By default all ports are created without LUN mapping, exposing all
CTL LUNs as before. But, if needed, LUN mapping can be manually set on
per-port basis via ctladm. For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.
Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition. LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed. It
allows same LUN to be exposed several times via multiple targets.
While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.
Discussed with: trasz
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
2015-02-01 21:50:28 +00:00
|
|
|
path /dev/zvol/tank/example_2
|
2015-08-24 09:33:12 +00:00
|
|
|
option vendor "FreeBSD"
|
2013-09-14 15:29:06 +00:00
|
|
|
}
|
|
|
|
}
|
2015-03-04 14:30:09 +00:00
|
|
|
|
|
|
|
target naa.50015178f369f092 {
|
|
|
|
port isp0
|
|
|
|
port isp1
|
|
|
|
lun 0 example_1
|
|
|
|
}
|
2013-09-14 15:29:06 +00:00
|
|
|
.Ed
|
2016-07-21 08:22:25 +00:00
|
|
|
.Pp
|
|
|
|
An equivalent configuration in UCL format, for use with
|
2018-04-10 08:14:31 +00:00
|
|
|
.Fl u :
|
2016-07-21 08:22:25 +00:00
|
|
|
.Bd -literal
|
|
|
|
auth-group {
|
|
|
|
ag0 {
|
|
|
|
chap-mutual = [
|
|
|
|
{
|
|
|
|
user = "user"
|
|
|
|
secret = "secretsecret"
|
|
|
|
mutual-user = "mutualuser"
|
|
|
|
mutual-secret = "mutualsecret"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
user = "user2"
|
|
|
|
secret = "secret2secret2"
|
|
|
|
mutual-user = "mutualuser"
|
|
|
|
mutual-secret = "mutualsecret"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
ag1 {
|
|
|
|
auth-type = none
|
|
|
|
initiator-name = [
|
|
|
|
"iqn.2012-06.com.example:initiatorhost1",
|
|
|
|
"iqn.2012-06.com.example:initiatorhost2"
|
|
|
|
]
|
|
|
|
initiator-portal = [192.168.1.1/24, "[2001:db8::de:ef]"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
portal-group {
|
|
|
|
pg0 {
|
|
|
|
discovery-auth-group = no-authentication
|
|
|
|
listen = [
|
|
|
|
0.0.0.0:3260,
|
|
|
|
"[::]:3260",
|
|
|
|
"[fe80::be:ef]:3261"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lun {
|
|
|
|
example_0 {
|
|
|
|
path = /dev/zvol/tank/example_0
|
|
|
|
blocksize = 4096
|
|
|
|
size = "4G"
|
|
|
|
}
|
|
|
|
|
|
|
|
example_1 {
|
|
|
|
path = /dev/zvol/tank/example_1
|
|
|
|
options {
|
|
|
|
naa = "0x50015178f369f093"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
example_2 {
|
|
|
|
path = /dev/zvol/tank/example_2
|
|
|
|
options {
|
|
|
|
vendor = "FreeBSD"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
target {
|
|
|
|
"iqn.2012-06.com.example:target0" {
|
|
|
|
alias = "Example target"
|
|
|
|
auth-group = no-authentication
|
|
|
|
lun = [
|
|
|
|
{ number = 0, name = example_0 },
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
"iqn.2012-06.com.example:target1" {
|
|
|
|
auth-group = ag0
|
|
|
|
portal-group { name = pg0 }
|
|
|
|
lun = [
|
|
|
|
{ number = 0, name = example_1 },
|
|
|
|
{ number = 1, name = example_2 }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
naa.50015178f369f092 {
|
|
|
|
port = isp0
|
|
|
|
lun = [
|
|
|
|
{ number = 0, name = example_1 }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.Ed
|
2013-09-14 15:29:06 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ctl 4 ,
|
|
|
|
.Xr ctladm 8 ,
|
2015-04-21 09:11:28 +00:00
|
|
|
.Xr ctld 8 ,
|
|
|
|
.Xr zfs 8
|
2013-09-14 15:29:06 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
configuration file functionality for
|
|
|
|
.Xr ctld 8
|
|
|
|
was developed by
|
2014-06-20 09:57:27 +00:00
|
|
|
.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
|
2013-09-14 15:29:06 +00:00
|
|
|
under sponsorship from the FreeBSD Foundation.
|