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. This is an
172 internal option that should not be set directly.
173
174 la_lba <val>
175 Specify the lowest aligned logical block address. This is an
176 internal option that should not be set directly.
177
178 optimal_xfer_gran <val>
179 Specify the optimal transfer granularity, to be reflected in the
180 Block Limits VPD. This is an internal option that should not be set
181 directly.
182
183 optimal_xfer_len <val>
184 Specify the optimal transfer length, to be reflected in the Block
185 Limits VPD. This is an internal option that should not be set
186 directly.
187
188 params <vals>
189 Pass additional parameters to tgtadm.
190
192 Example configuration file:
193
194 <target iqn.2007-04.com.example:san.monitoring>
195 backing-store /dev/san/monitoring
196
197 # if no "incominguser" is specified, it is not used
198 incominguser backup secretpass12
199
200 # defaults to ALL if no "initiator-address" is specified
201 initiator-address 192.168.1.2
202 </target>
203
204 <target iqn.2007-02.com.example:san.xen1>
205 backing-store /dev/san/xen1-disk1 # LUN1
206 direct-store /dev/san/xen1-disk2 # LUN2
207
208 initiator-address 192.168.1.2 # Allowed IP
209 initiator-address 192.168.5.6 # Allowed IP
210
211 incominguser user1 secretpass12
212 incominguser user2 secretpass23
213
214 outgoinguser userA secretpassA
215 </target>
216
217 <target iqn.2007-02.com.example:san.xen2>
218 backing-store /dev/san/xen2
219 </target>
220
221 <target iqn.2007-06.com.example:san.vmware1>
222 backing-store /dev/san/vmware1
223 </target>
224
225
227 /etc/tgt/targets.conf
228 Configuration file for tgt-admin.
229
230 /usr/share/doc/tgt/targets.conf.example
231 Example configuration file for tgt-admin.
232
234 tgtd(8), tgtadm(8), tgtimg(8), tgt-setup-lun(8).
235 http://stgt.sourceforge.net/
236
238 Report bugs to <stgt@vger.kernel.org>
239
240
241
242[FIXME: source] 05/11/2016 TARGETS.CONF(5)