1TGT-ADMIN(8) TGT-ADMIN(8)
2
3
4
6 tgt-admin - Linux SCSI Target Configuration Tool
7
9 tgt-admin [-e --execute] [--delete <value>] [--offline <value>]
10 [--ready <value>] [-s --show] [-C --control-port <NNNN>]
11 [-c --conf <file>] [--ignore-errors] [-f --force]
12 [-p --pretend] [--dump] [-v --verbose] [-h --help]
13
15 tgt-admin is a utility which allows a persistent configuration of
16 targets and luns. It uses tgtadm commands to create, delete and show
17 targets.
18
20 -e, --execute
21 Read /etc/tgt/targets.conf and execute tgtadm commands. If the
22 target already exists, it won´t be processed. See --update.
23
24 -d, --delete <value>
25 Delete all or selected targets. The target will be deleted only if
26 it´s not used (no initiator is connected to it).
27
28 If you want to delete targets which are in use, you have to add the
29 "--force" flag.
30
31 Example usage:
32 --delete ALL - delete all targets
33 --delete tid=4 - delete target 4
34 (target with tid 4)
35 --delete iqn.2008-08.com.example:some.target
36 - delete this target
37
38
39
40 --offline
41 Put all or selected targets in offline state.
42
43 Example usage:
44 --offline ALL - offline all targets
45 --offline tid=4 - offline target 4
46 (target with tid 4)
47 --offline iqn.2008-08.com.example:some.target
48 - offline this target
49
50
51
52 --ready
53 Put all or selected targets in ready state.
54
55 Example usage:
56 --ready ALL - ready all targets
57 --ready tid=4 - ready target 4
58 (target with tid 4)
59 --ready iqn.2008-08.com.example:some.target
60 - ready this target
61
62
63
64 --update <value>
65 Update all or selected targets. The target will be updated only if
66 it´s not used (no initiator is connected to it).
67
68 If you want to update targets which are in use, you have to add
69 "--force" flag.
70
71 Example usage:
72 --update ALL - ready all targets
73 --update tid=4 - ready target 4
74 (target with tid 4)
75 --update iqn.2008-08.com.example:some.target
76 - update this target
77
78
79
80 -s, --show
81 Show all the targets.
82
83 -C, --control-port <NNNN>
84 It is possible to run multiple concurrent instances of tgtd on a
85 host. This argument is used to control which instance the tgt-admin
86 command will operate on.
87
88 -c, --conf <configuration file>
89 Specify an alternative configuration file instead of
90 /etc/tgt/target.conf, which is the default.
91
92 --ignore-errors
93 Continue even if tgtadm exits with non-zero code.
94
95 -f, --force
96 Force some operations even if the target is in use.
97
98 -p, --pretend
99 Only print tgtadm options which would be used; don´t execute any
100 actions. Assumes -v.
101
102 --dump
103 Dump current tgtd configuration. Note: does not include detailed
104 parameters, like write caching.
105
106 -v, --verbose
107 Increase verbosity (show tgtadm commands used).
108
109 -h, --help
110 Display a list of available options and exit.
111
113 The defualt configuration file is /etc/tgt/target.conf. It defines all
114 the targets and their properties. The configuration file is in XML
115 format and uses tags. Configuration file contains several target
116 blocks, where each block contains target´s properties such as storage
117 devices, initator ACL and authorization information. You can include
118 other config files using: include /etc/tgt/xen/*.conf.
119
120 backing-store
121 Defines a virtual device on the target.
122
123 direct-store
124 Defines a direct mapped device with the same properties as the
125 physical device (such as VENDOR_ID, SERIAL_NUM, etc.)
126
127 initiator-address
128 Allows connections only from the specified IP address. Defaults to
129 ALL if no "initiator-address" is specified.
130
131 incominguser
132 Define iscsi incoming authentication setting. If no "incominguser"
133 is specified, it is not used.
134
135 outgoinguser
136 Define iscsi outgoing authentication setting. If no "outgoinguser"
137 is specified, it is not used.
138
139 Example configuration file:
140
141 <target iqn.2007-04.com.example:san.monitoring>
142 backing-store /dev/san/monitoring
143
144 # if no "incominguser" is specified, it is not used
145 incominguser backup secretpass12
146
147 # defaults to ALL if no "initiator-address" is specified
148 initiator-address 192.168.1.2
149 </target>
150
151 <target iqn.2007-02.com.example:san.xen1>
152 backing-store /dev/san/xen1-disk1 # LUN1
153 direct-store /dev/san/xen1-disk2 # LUN2
154
155 initiator-address 192.168.1.2 # Allowed IP
156 initiator-address 192.168.5.6 # Allowed IP
157
158 incominguser user1 secretpass12
159 incominguser user2 secretpass23
160
161 outgoinguser userA secretpassA
162 </target>
163
164 <target iqn.2007-02.com.example:san.xen2>
165 backing-store /dev/san/xen2
166 </target>
167
168 <target iqn.2007-06.com.example:san.vmware1>
169 backing-store /dev/san/vmware1
170 </target>
171
172
174 /etc/tgt/targets.conf
175 Configuration file for tgt-admin.
176
177 /usr/share/doc/tgt/targets.conf.example
178 Example configuration file for tgt-admin.
179
181 tgtd(8), tgtadm(8), tgtimg(8), tgt-setup-lun(8).
182 http://stgt.sourceforge.net/
183
185 Report bugs to <stgt@vger.kernel.org>
186
187
188
189 07/29/2010 TGT-ADMIN(8)