3
This documents an example to set up tgt targets utilising existing SCSI
4
targets on the host utilizing tgt passthrough module and /dev/sg paths.
6
The hardware to be 'exported' via the SCSI target framework is an
7
IBM 3573-TL library with a single LTO4 drive.
9
Physical tape library connected and configured to host:
11
[0:0:0:0] disk MAXTOR ATLAS10K4_36SCA DFM0 /dev/sda /dev/sg0
12
[0:0:6:0] process PE/PV 1x3 SCSI BP 1.1 - /dev/sg1
13
[2:0:1:0] tape IBM ULT3580-TD4 8192 /dev/st1 /dev/sg4
14
[2:0:1:1] mediumx IBM 3573-TL 6.50 - /dev/sg5
16
Please refer to the README.iscsi, README.iser or README.fcoe for
17
instructions specific to setting up the transport layer specific section.
19
Many of the examples below are using the iSCSI lld (low Level) transport.
24
Please refer to 'Starting the daemon' in the README.iscsi, README.iser or README.fcoe
25
on instructions for correctly starting the daemon for your transport of choice.
30
Everyting is configured via the tgtadm management tool.
32
Please refer to "Configuration" in README.iscsi, README.iser or README.fcoe on how to
33
configure your target for the transport of choice.
35
Return to here for further instructions on setting up each logical unit using the
38
An example to setup the target (target ID 1) for iSCSI
39
host:~/tgt# ./usr/tgtadm --lld iscsi --op new --mode target --tid 1 \
40
-T iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
42
To display your target configuration:
43
host:~/tgt# ./usr/tgtadm --lld iscsi --op show --mode target
44
Target 1: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
48
I_T nexus information:
55
Backing store: No backing store
59
The controller device for management with lun 0 was created
60
automatically. You can't remove it.
62
Now it's time to add a logical unit to the target:
63
(The tape drive connected via /dev/sg4 - refer to 'lsscsi' output above)
64
The important flags are:
65
- Specify device type as passthruough
67
- Backing store type is the '/dev/sg' paths
69
- Backing store path to use
72
host:~/tgt# ./usr/tgtadm --lld iscsi --op new --mode logicalunit \
73
--tid 1 --lun 1 --bstype=sg --device-type=pt -b /dev/sg4
75
To display the current configuration:
77
host:~/tgt# ./usr/tgtadm --lld iscsi --op show --mode target
78
Target 1: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
82
I_T nexus information:
89
Backing store: No backing store
97
Backing store type: sg
98
Backing store path: /dev/sg4
103
To add another logical unit to this target:
104
host:~/tgt# ./usr/tgtadm --lld iscsi --op new --mode logicalunit \
105
--tid 1 --lun 2 --bstype=sg --device-type=pt -b /dev/sg5
108
If you don't need to configure this target any more, enable the target
109
to accept any initiators:
111
host:~/tgt# ./usr/tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
113
Note "ACL information" section. "ALL" means that this target accepts
114
any initiators. The ACL feature also provides the access control based
115
on initiators' addresses.
117
For further instructions on ACL and account setup, please refer to the README.iscsi
119
As above, use the '--op show' option to display your current setup.
120
host:~/tgt# ./usr/tgtadm --lld iscsi --op show --mode target
121
Target 1: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
125
I_T nexus information:
132
Backing store: No backing store
135
SCSI ID: IET 00010002
140
Backing store type: sg
141
Backing store path: /dev/sg4
145
SCSI ID: IET 00010002
150
Backing store type: sg
151
Backing store path: /dev/sg5
159
iSCSI Initiator Information
161
After the target accepts initiators, the system information would be
162
something like the following:
164
Linux open-iscsi initiator
165
hostb:~ # iscsiadm -m discovery -t sendtargets -p 10.251.60.20
166
10.251.60.20:3260,1 iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
168
hostb:~ # iscsiadm -m node -T iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz \
169
-p 10.251.60.20 --login
170
Logging in to [iface: default, target: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz, portal: 10.251.60.20,3260]
171
Login to [iface: default, target: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz, portal: 10.251.60.20,3260]: successful
174
[0:0:0:0] cd/dvd TSSTcorp DVD-ROM TS-L333A D100 /dev/sr0 /dev/sg0
175
[2:0:0:0] disk SEAGATE ST3400755SS NS25 /dev/sda /dev/sg1
176
[2:0:1:0] disk SEAGATE ST3400755SS NS25 /dev/sdb /dev/sg2
177
[3:0:0:0] disk DGC DISK 0429 /dev/sdc /dev/sg3
178
[3:0:1:0] disk DGC DISK 0429 /dev/sdd /dev/sg4
179
[11:0:0:0] storage IET Controller 0001 - /dev/sg5
180
[11:0:0:1] tape IBM ULT3580-TD4 8192 /dev/st0 /dev/sg6
181
[11:0:0:2] mediumx IBM 3573-TL 6.50 - /dev/sg7
184
Shutdown the target cleanly
185
---------------------------
186
host:~/tgt# tgtadm --op unbind --mode target --tid 1 -I ALL
187
host:~/tgt# tgtadm --op delete --mode conn --tid 1
188
host:~/tgt# tgtadm --op delete --mode target --tid 1
189
host:~/tgt# tgtadm --op delete --mode system