~ubuntu-branches/ubuntu/precise/tgt/precise

« back to all changes in this revision

Viewing changes to doc/README.passthrough

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-02-08 10:31:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208103104-oots1az6acnkfvuw
Tags: 1:1.0.13-0ubuntu1
* New upstream release.
* debian/patches/make-tgt-setup-lun-executable: Dropped no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Preface
 
2
-------------
 
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.
 
5
 
 
6
The hardware to be 'exported' via the SCSI target framework is an
 
7
IBM 3573-TL library with a single LTO4 drive.
 
8
 
 
9
Physical tape library connected and configured to host:
 
10
# lsscsi -g
 
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
 
15
 
 
16
Please refer to the README.iscsi, README.iser or README.fcoe for
 
17
instructions specific to setting up the transport layer specific section.
 
18
 
 
19
Many of the examples below are using the iSCSI lld (low Level) transport.
 
20
 
 
21
 
 
22
Starting the daemon
 
23
-------------
 
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.
 
26
 
 
27
 
 
28
Configuration
 
29
-------------
 
30
Everyting is configured via the tgtadm management tool.
 
31
 
 
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.
 
34
 
 
35
Return to here for further instructions on setting up each logical unit using the
 
36
passthrough module.
 
37
 
 
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
 
41
 
 
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
 
45
    System information:
 
46
        Driver: iscsi
 
47
        Status: running
 
48
    I_T nexus information:
 
49
    LUN information:
 
50
        LUN: 0
 
51
            Type: controller
 
52
            SCSI ID: deadbeaf1:0
 
53
            SCSI SN: beaf10
 
54
            Size: 0
 
55
            Backing store: No backing store
 
56
    Account information:
 
57
    ACL information:
 
58
 
 
59
The controller device for management with lun 0 was created
 
60
automatically. You can't remove it.
 
61
 
 
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
 
66
                      "--device-type=pt"
 
67
 - Backing store type is the '/dev/sg' paths
 
68
                      "--bstype=sg"
 
69
 - Backing store path to use
 
70
                     "-b /dev/sg4"
 
71
 
 
72
host:~/tgt# ./usr/tgtadm --lld iscsi --op new --mode logicalunit \
 
73
        --tid 1 --lun 1 --bstype=sg --device-type=pt -b /dev/sg4
 
74
 
 
75
To display the current configuration:
 
76
 
 
77
host:~/tgt# ./usr/tgtadm --lld iscsi --op show --mode target
 
78
Target 1: iqn.2001-04.com.example:storage.vtl.amiens.sys1.xyz
 
79
    System information:
 
80
        Driver: iscsi
 
81
        Status: running
 
82
    I_T nexus information:
 
83
    LUN information:
 
84
        LUN: 0
 
85
            Type: controller
 
86
            SCSI ID: deadbeaf1:0
 
87
            SCSI SN: beaf10
 
88
            Size: 0
 
89
            Backing store: No backing store
 
90
        LUN: 1
 
91
            Type: (null)
 
92
            SCSI ID: IET     00010002
 
93
            SCSI SN: beaf12
 
94
            Size: 0 MB
 
95
            Online: Yes
 
96
            Removable media: No
 
97
            Backing store type: sg
 
98
            Backing store path: /dev/sg4
 
99
            Backing store flags:
 
100
    Account information:
 
101
    ACL information:
 
102
 
 
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
 
106
 
 
107
 
 
108
If you don't need to configure this target any more, enable the target
 
109
to accept any initiators:
 
110
 
 
111
host:~/tgt# ./usr/tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
 
112
 
 
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.
 
116
 
 
117
For further instructions on ACL and account setup, please refer to the README.iscsi
 
118
 
 
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
 
122
    System information:
 
123
        Driver: iscsi
 
124
        Status: running
 
125
    I_T nexus information:
 
126
    LUN information:
 
127
        LUN: 0
 
128
            Type: controller
 
129
            SCSI ID: deadbeaf1:0
 
130
            SCSI SN: beaf10
 
131
            Size: 0
 
132
            Backing store: No backing store
 
133
        LUN: 1
 
134
            Type: (null)
 
135
            SCSI ID: IET     00010002
 
136
            SCSI SN: beaf12
 
137
            Size: 0 MB
 
138
            Online: Yes
 
139
            Removable media: No
 
140
            Backing store type: sg
 
141
            Backing store path: /dev/sg4
 
142
            Backing store flags:
 
143
        LUN: 2
 
144
            Type: (null)
 
145
            SCSI ID: IET     00010002
 
146
            SCSI SN: beaf12
 
147
            Size: 0 MB
 
148
            Online: Yes
 
149
            Removable media: No
 
150
            Backing store type: sg
 
151
            Backing store path: /dev/sg5
 
152
            Backing store flags:
 
153
    Account information:
 
154
    ACL information:
 
155
        ALL
 
156
 
 
157
 
 
158
 
 
159
iSCSI Initiator Information
 
160
-------------
 
161
After the target accepts initiators, the system information would be
 
162
something like the following:
 
163
 
 
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
 
167
 
 
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
 
172
 
 
173
hostb:~ # lsscsi -g
 
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
 
182
 
 
183
 
 
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
 
190