| 4 |
- |
1 |
# This is a sample config file for tgt-admin.
|
|
|
2 |
# By default, tgt-admin looks for its config file in /etc/tgt/targets.conf
|
|
|
3 |
#
|
|
|
4 |
# The "#" symbol disables the processing of a line.
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
# This one includes other config files:
|
|
|
8 |
|
|
|
9 |
#include /etc/tgt/temp/*.conf
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
# Set the driver. If not specified, defaults to "iscsi".
|
|
|
13 |
#
|
|
|
14 |
# This can be iscsi or iser. To override a specific target set the
|
|
|
15 |
# "driver" setting in the target's config.
|
|
|
16 |
default-driver iscsi
|
|
|
17 |
|
|
|
18 |
#<target iqn.2008-09.com.example:iser>
|
|
|
19 |
# Example: the next line would override default driver type.
|
|
|
20 |
# driver iser
|
|
|
21 |
#<target>
|
|
|
22 |
|
|
|
23 |
# Set iSNS parameters, if needed
|
|
|
24 |
|
|
|
25 |
#iSNSServerIP 192.168.111.222
|
|
|
26 |
#iSNSServerPort 3205
|
|
|
27 |
#iSNSAccessControl On
|
|
|
28 |
#iSNS On
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
# Continue if tgtadm exits with non-zero code (equivalent of
|
|
|
32 |
# --ignore-errors command line option)
|
|
|
33 |
#ignore-errors yes
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
# Sample target with one LUN only. Defaults to allow access for all initiators:
|
|
|
37 |
|
|
|
38 |
#<target iqn.2008-09.com.example:server.target1>
|
|
|
39 |
# backing-store /dev/LVM/somedevice
|
|
|
40 |
#</target>
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
# Similar, but we use "direct-store" instead of "backing-store".
|
|
|
44 |
# "direct-store" reads drive parameters with sg_inq command and sets them to
|
|
|
45 |
# the target.
|
|
|
46 |
# Parameters fatched with sg_inq are:
|
|
|
47 |
# - Vendor identification
|
|
|
48 |
# - Product identification
|
|
|
49 |
# - Product revision level
|
|
|
50 |
# - Unit serial number (if present)
|
|
|
51 |
# We also specify "incominguser".
|
|
|
52 |
|
|
|
53 |
#<target iqn.2008-09.com.example:server.target2>
|
|
|
54 |
# direct-store /dev/sdd
|
|
|
55 |
# incominguser someuser secretpass12
|
|
|
56 |
#</target>
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
# An example with multiple LUNs, disabled write-cache (tgtd enables write-cache
|
|
|
60 |
# by default) and vendor identification set to "MyVendor"
|
|
|
61 |
|
|
|
62 |
#<target iqn.2008-09.com.example:server.target3>
|
|
|
63 |
# backing-store /dev/LVM/somedevice1 # Becomes LUN 1
|
|
|
64 |
# backing-store /dev/LVM/somedevice2 # Becomes LUN 2
|
|
|
65 |
# backing-store /dev/LVM/somedevice3 # Becomes LUN 3
|
|
|
66 |
# write-cache off
|
|
|
67 |
# vendor_id MyCompany Inc.
|
|
|
68 |
#</target>
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
# Similar to the one above, but we fetch vendor_id, product_id, product_rev and
|
|
|
72 |
# scsi_sn from the disks.
|
|
|
73 |
# Vendor identification (vendor_id) is replaced in all disks by "MyVendor"
|
|
|
74 |
|
|
|
75 |
#<target iqn.2008-09.com.example:server.target4>
|
|
|
76 |
# direct-store /dev/sdb # Becomes LUN 1
|
|
|
77 |
# direct-store /dev/sdc # Becomes LUN 2
|
|
|
78 |
# direct-store /dev/sdd # Becomes LUN 3
|
|
|
79 |
# write-cache off
|
|
|
80 |
# vendor_id MyCompany Inc.
|
|
|
81 |
#</target>
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
# Note that "first-device-first-lun numbering" will work only for simple
|
|
|
85 |
# scenarios above, where _only_ direct-store _or_ backing-store is used.
|
|
|
86 |
# If you mix backing-store and direct-store, then all backing-store entries
|
|
|
87 |
# are processed before direct-store-entries.
|
|
|
88 |
|
|
|
89 |
#<target iqn.2008-09.com.example:server.target4>
|
|
|
90 |
# direct-store /dev/sdb # Becomes LUN 3
|
|
|
91 |
# backing-store /dev/sdc # Becomes LUN 1
|
|
|
92 |
# direct-store /dev/sdd # Becomes LUN 4
|
|
|
93 |
# backing-store /dev/sde # Becomes LUN 2
|
|
|
94 |
#</target>
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
# Even more complicated example - each device has different parameters.
|
|
|
98 |
# You can use indentation to make the config file more readable.
|
|
|
99 |
# Note that LUNs will be assigned more or less randomly here (and still
|
|
|
100 |
# backing-store get LUNs assigned before drect-store).
|
|
|
101 |
# You can specify multiple mode_page parameters (they are commented out
|
|
|
102 |
# in this example).
|
|
|
103 |
# Note that some parameters (write-cache, scsi_sn) were specified "globally".
|
|
|
104 |
# "Global" parameters will be applied to all LUNs; they can be overwritten
|
|
|
105 |
# "locally", per LUN.
|
|
|
106 |
# If lun is not specified, it will be allocated automatically (first available).
|
|
|
107 |
|
|
|
108 |
#<target iqn.2008-09.com.example:server.target5>
|
|
|
109 |
|
|
|
110 |
# <direct-store /dev/sdd>
|
|
|
111 |
# vendor_id VENDOR1
|
|
|
112 |
# removable 1
|
|
|
113 |
# device-type cd
|
|
|
114 |
# lun 1
|
|
|
115 |
# </direct-store>
|
|
|
116 |
|
|
|
117 |
# <direct-store /dev/sda>
|
|
|
118 |
# vendor_id VENDOR2
|
|
|
119 |
# lun 2
|
|
|
120 |
# </direct-store>
|
|
|
121 |
|
|
|
122 |
# <backing-store /dev/sdb1>
|
|
|
123 |
# vendor_id back1
|
|
|
124 |
# scsi_sn SERIAL
|
|
|
125 |
# write-cache on
|
|
|
126 |
# lun 3 # lun is commented out - will be allocated automatically
|
|
|
127 |
# </backing-store>
|
|
|
128 |
|
|
|
129 |
# <backing-store /dev/sdd1>
|
|
|
130 |
# vendor_id back2
|
|
|
131 |
#mode_page 8:0:18:0x10:0:0xff....
|
|
|
132 |
#mode_page 8:0:18:0x10:0:0xff....
|
|
|
133 |
#bs-type aio
|
|
|
134 |
# lun 15
|
|
|
135 |
# </backing-store>
|
|
|
136 |
|
|
|
137 |
# Some more parameters which can be specified locally or globally:
|
|
|
138 |
#scsi_id ...
|
|
|
139 |
#scsi_sn ...
|
|
|
140 |
#vendor_id ...
|
|
|
141 |
#product_id ...
|
|
|
142 |
#product_rev ...
|
|
|
143 |
#sense_format ...
|
|
|
144 |
#removable ...
|
|
|
145 |
#online ...
|
|
|
146 |
#readonly [1 | 0] - 1 means readonly and 0 is read-write
|
|
|
147 |
#path ...
|
|
|
148 |
#mode_page 8:0:18:0x10:0:0xff....
|
|
|
149 |
#mode_page 8:0:18:0x10:0:0xff....
|
|
|
150 |
#device-type ...
|
|
|
151 |
#bs-type ... # backing store type - default rdwr, can be aio, mmap, etc...
|
|
|
152 |
#allow-in-use yes # if specified globally, can't be overwritten locally
|
|
|
153 |
|
|
|
154 |
# write-cache off
|
|
|
155 |
# scsi_sn multipath-10
|
|
|
156 |
|
|
|
157 |
# Parameters below are only global. They can't be configured per LUN.
|
|
|
158 |
# Only allow connections from 192.168.100.1 and 192.168.200.5
|
|
|
159 |
# initiator-address 192.168.100.1
|
|
|
160 |
# initiator-address 192.168.200.5
|
|
|
161 |
|
|
|
162 |
# Tuning parameters (global, per target)
|
|
|
163 |
#MaxRecvDataSegmentLength 8192
|
|
|
164 |
#MaxXmitDataSegmentLength 8192
|
|
|
165 |
#HeaderDigest None
|
|
|
166 |
#DataDigest None
|
|
|
167 |
#InitialR2T Yes
|
|
|
168 |
#MaxOutstandingR2T 1
|
|
|
169 |
#ImmediateData Yes
|
|
|
170 |
#FirstBurstLength 65536
|
|
|
171 |
#MaxBurstLength 262144
|
|
|
172 |
#DataPDUInOrder Yes
|
|
|
173 |
#DataSequenceInOrder Yes
|
|
|
174 |
#ErrorRecoveryLevel 0
|
|
|
175 |
#IFMarker No
|
|
|
176 |
#OFMarker No
|
|
|
177 |
#DefaultTime2Wait 2
|
|
|
178 |
#DefaultTime2Retain 20
|
|
|
179 |
#OFMarkInt Reject
|
|
|
180 |
#IFMarkInt Reject
|
|
|
181 |
#MaxConnections 1
|
|
|
182 |
|
|
|
183 |
# Allowed incoming users
|
|
|
184 |
# incominguser user1 secretpass12
|
|
|
185 |
# incominguser user2 secretpass23
|
|
|
186 |
|
|
|
187 |
# Outgoing user
|
|
|
188 |
# outgoinguser userA secretpassA
|
|
|
189 |
|
|
|
190 |
#</target>
|
|
|
191 |
|
|
|
192 |
|
|
|
193 |
# The device will have lun 1 unless you specify something else
|
|
|
194 |
#<target iqn.2008-09.com.example:server.target6>
|
|
|
195 |
# backing-store /dev/LVM/somedevice
|
|
|
196 |
# lun 10
|
|
|
197 |
#</target>
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
# Devices which are in use (by system: mounted, for swap, part of RAID, or by
|
|
|
201 |
# userspace: dd, by tgtd for another target etc.) can't be used, unless you use
|
|
|
202 |
# --force flag or add 'allow-in-use yes' option
|
|
|
203 |
#<target iqn.2008-09.com.example:server.target7>
|
|
|
204 |
# backing-store /dev/LVM/somedevice
|
|
|
205 |
# allow-in-use yes
|
|
|
206 |
#</target>
|
|
|
207 |
|
|
|
208 |
#<target iqn.2008-09.com.example:server.target8>
|
|
|
209 |
# <backing-store /dev/LVM/somedevice>
|
|
|
210 |
# scsi_sn serial1
|
|
|
211 |
# </backing-store>
|
|
|
212 |
|
|
|
213 |
# <backing-store /dev/LVM/somedevice2>
|
|
|
214 |
# scsi_sn serial2
|
|
|
215 |
# </backing-store>
|
|
|
216 |
|
|
|
217 |
# allow-in-use yes
|
|
|
218 |
#</target>
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
# Not supported configurations, and therefore, commented out:
|
|
|
225 |
|
|
|
226 |
#<target iqn.2008-09.com.example:server.target9>
|
|
|
227 |
# backing-store /dev/LVM/somedevice1
|
|
|
228 |
# backing-store /dev/LVM/somedevice2
|
|
|
229 |
# lun 10
|
|
|
230 |
# lun 11
|
|
|
231 |
#</target>
|
|
|
232 |
|
|
|
233 |
#<target iqn.2008-09.com.example:server.target10>
|
|
|
234 |
# <direct-store /dev/sdd>
|
|
|
235 |
# vendor_id VENDOR1
|
|
|
236 |
# </direct-store>
|
|
|
237 |
#
|
|
|
238 |
# direct-store /dev/sdc
|
|
|
239 |
#</target>
|
|
|
240 |
|
|
|
241 |
# This one will break the parser:
|
|
|
242 |
|
|
|
243 |
#<target iqn.2008-09.com.example:server.target11>
|
|
|
244 |
# <direct-store /dev/sdd>
|
|
|
245 |
# vendor_id VENDOR1
|
|
|
246 |
# </direct-store>
|
|
|
247 |
#
|
|
|
248 |
# direct-store /dev/sdc
|
|
|
249 |
#
|
|
|
250 |
# <direct-store /dev/sdd>
|
|
|
251 |
# vendor_id VENDOR1
|
|
|
252 |
# </direct-store>
|
|
|
253 |
#</target>
|