1TARGETS.CONF(5) [FIXME: manual] TARGETS.CONF(5)
2
3
4
6 targets.conf - Linux SCSI Target Configuration File
7
9 tgt-admin uses /etc/tgt/targets.conf to initialize tgtd configuration,
10 by default. Its layout uses a HTML-like structure, with a hierarchy of
11 nested tags to define targets and LUNs.
12
14 Global directives configure options that are global to tgtd's
15 configuration, as well as defining exported targets, via target
16 sections.
17
18 Target sections contain directives specific to one target device. They
19 define each target's exported LUNs via "backing-store" and
20 "direct-store" directives, as well as other target-wide options.
21
22 LUN directives ("backing-store" and "direct-store") may contain options
23 specific to a single exported logical unit.
24
26 With the exception of target directives, each of these should occur at
27 most once.
28
29 <target <IQN>>
30 Defines a the start of a target definition. IQN is an ISCSI
31 Qualified Name such as "iqn.2001-04.com.example:storage1".
32
33 Within this block should be target-level directives, as documented
34 below.
35
36 The target definition ends with "</target>"
37
38 default-driver <lld>
39 Instead of specifying a driver type for each target, default-driver
40 defines a default low-level driver for all exported targets. It may
41 be overriden on a per-target basis. Valid lld values are "iscsi" or
42 "iser". Since iscsi is assumed if this directive is not present, it
43 is only generally needed if iser is the desired default.
44
45 include <path>
46 Include the configuration from another configuration file.
47 Wildcards are allowed, so an example like "include
48 /etc/tgt/xen/*.conf" is allowed.
49
50 ignore-errors yes
51 Errors from tgtadm will be ignored. Default is no.
52
53 control-port <port>
54 Define a different local socket key for communicating with tgtd.
55 Defaults to 0. This is only generally useful if multiple instances
56 of tgtd are in use.
57
58 iSNSServerIP <addr>
59 Define the address of the iSNS server in IPv4 dotted-quad address
60 format. Required when using iSNS, otherwise ignored.
61
62 iSNSAccessControl <value>
63 Set iSNS access control. Valid values are "On" or "Off". Required
64 when using iSNS, otherwise ignored.
65
66 iSNSServerPort <port>
67 Set a different iSNS server port. Default is 3205. Optional when
68 using iSNS, otherwise ignored.
69
70 iSNS On
71 Enable iSNS. Only valid value is "On". Default is off.
72
73 incomingdiscoveryuser <user> <userpassword>
74 Define iscsi incoming discovery authentication setting. If no value
75 is given, no authentication is performed.
76
77 outgoingdiscoveryuser <user> <userpassword>
78 Define iscsi outgoing discovery authentication setting. If no value
79 is given, no authentication is performed.
80
82 Each target may export multiple block devices, or logical units (LUNs).
83 For the purposes of LUN numbering, backing-store directives are
84 processed before direct-store directives.
85
86 backing-store <path>
87 Defines a logical unit (LUN) exported by the target. This may
88 specify either a regular file, or a block device.
89
90 direct-store <path>
91 Defines a direct mapped logical unit (LUN) with the same properties
92 as the physical device (such as VENDOR_ID, SERIAL_NUM, etc.)
93
94 driver <lld>
95 Define the low-level driver to use for this target, either "iscsi"
96 or "iser" (without quotes). This overrides the "default-driver"
97 global directive.
98
99 initiator-address <addr>
100 Allows connections only from the specified IP address. Defaults to
101 ALL if no initiator-address directive is specified.
102
103 initiator-name <addr>
104 Allows connections only from the specified initiator name.
105
106 incominguser <user> <userpassword>
107 Define iscsi incoming authentication setting. If no "incominguser"
108 is specified, it is not used. This directive may be used multiple
109 times per target.
110
111 outgoinguser <user> <userpassword>
112 Define iscsi outgoing authentication setting. If no "outgoinguser"
113 is specified, it is not used. This directive may be used multiple
114 times per target.
115
116 controller_tid <val>
117 Define the tid of the controller. Default is next available
118 integer.
119
121 All of these may be listed at the target level (and apply to all LUNs)
122 or within an individual LUN's definition, if it is defined using the
123 container-style, multi-line definition, rather than single-line
124 definition format:
125
126 <backing-store /dev/sdb1>
127 # LUN directives go here
128 </backing-store>
129
130 <direct-store /dev/sdb1>
131 # LUN directives go here
132 </direct-store>
133
134
135 It is recommended to use either single-line or container-style LUN
136 definitions within a target. Mixing styles can cause parser errors.
137
138 write-cache <val>
139 "on" or "off", default on.
140
141 scsi_id <val>
142
143 scsi_sn <val>
144
145 vendor_id <val>
146
147 product_id <val>
148
149 product_rev <val>
150
151 sense_format <val>
152
153 removable <val>
154
155 path <val>
156
157 mode_page <val>
158
159 readonly <val>
160
161 device-type <val>
162
163 bs-type <val>
164
165 allow-in-use <val>
166
167 block-size <val>
168 Specify the block size for this LUN.
169
170 lbppbe <val>
171 Specify the Logical blocks per physical block exponent. By default
172 TGTD will set the lbppbe to automatically match the underlying
173 filesystem. Use this parameter to override that setting.
174
175 This is an internal option that should not be set directly.
176
177 la_lba <val>
178 Specify the lowest aligned logical block address. This is an
179 internal option that should not be set directly.
180
181 optimal_xfer_gran <val>
182 Specify the optimal transfer granularity, to be reflected in the
183 Block Limits VPD. This is an internal option that should not be set
184 directly.
185
186 optimal_xfer_len <val>
187 Specify the optimal transfer length, to be reflected in the Block
188 Limits VPD. This is an internal option that should not be set
189 directly.
190
191 params <vals>
192 Pass additional parameters to tgtadm.
193
195 Example configuration file:
196
197 <target iqn.2007-04.com.example:san.monitoring>
198 backing-store /dev/san/monitoring
199
200 # if no "incominguser" is specified, it is not used
201 incominguser backup secretpass12
202
203 # defaults to ALL if no "initiator-address" is specified
204 initiator-address 192.168.1.2
205 </target>
206
207 <target iqn.2007-02.com.example:san.xen1>
208 backing-store /dev/san/xen1-disk1 # LUN1
209 direct-store /dev/san/xen1-disk2 # LUN2
210
211 initiator-address 192.168.1.2 # Allowed IP
212 initiator-address 192.168.5.6 # Allowed IP
213
214 incominguser user1 secretpass12
215 incominguser user2 secretpass23
216
217 outgoinguser userA secretpassA
218 </target>
219
220 <target iqn.2007-02.com.example:san.xen2>
221 backing-store /dev/san/xen2
222 </target>
223
224 <target iqn.2007-06.com.example:san.vmware1>
225 backing-store /dev/san/vmware1
226 </target>
227
228
230 /etc/tgt/targets.conf
231 Configuration file for tgt-admin.
232
233 /usr/share/doc/tgt/targets.conf.example
234 Example configuration file for tgt-admin.
235
237 tgtd(8), tgtadm(8), tgtimg(8), tgt-setup-lun(8).
238 http://stgt.sourceforge.net/
239
241 Report bugs to <stgt@vger.kernel.org>
242
243
244
245[FIXME: source] 07/29/2020 TARGETS.CONF(5)