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

« back to all changes in this revision

Viewing changes to doc/tgtadm.8.xml

  • 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:
16
16
        <cmdsynopsis>
17
17
                <command>tgtadm [OPTIONS]...</command>
18
18
                <arg choice="opt">-C --control-port &lt;port&gt;</arg>
19
 
                <arg choice="opt">--lld &lt;driver&gt;</arg>
20
 
                <arg choice="opt">--op &lt;operation&gt;</arg>
21
 
                <arg choice="opt">--mode &lt;mode&gt;</arg>
22
 
                <arg choice="opt">--tid &lt;tid&gt;</arg>
 
19
                <arg choice="opt">-L --lld &lt;driver&gt;</arg>
 
20
                <arg choice="opt">-o --op &lt;operation&gt;</arg>
 
21
                <arg choice="opt">-m --mode &lt;mode&gt;</arg>
 
22
                <arg choice="opt">-t --tid &lt;id&gt;</arg>
23
23
                <arg choice="opt">-T --targetname &lt;targetname&gt;</arg>
24
24
                <arg choice="opt">-Y --device-type &lt;type&gt;</arg>
25
 
                <arg choice="opt">--lun &lt;lun&gt;</arg>
26
 
                <arg choice="opt">--backing-store &lt;path&gt;</arg>
27
 
                <arg choice="opt">--initiator-address &lt;address&gt;</arg>
28
 
                <arg choice="opt">--name &lt;parameter&gt;</arg>
29
 
                <arg choice="opt">--value &lt;value&gt;</arg>
30
 
                <arg choice="opt">--params &lt;param=value[,param=value...]&gt;</arg>
31
 
                <arg choice="opt">--help</arg>
 
25
                <arg choice="opt">-l --lun &lt;lun&gt;</arg>
 
26
                <arg choice="opt">-b --backing-store &lt;path&gt;</arg>
 
27
                <arg choice="opt">-E --bstype &lt;type&gt;</arg>
 
28
                <arg choice="opt">-I --initiator-address &lt;address&gt;</arg>
 
29
                <arg choice="opt">-n --name &lt;parameter&gt;</arg>
 
30
                <arg choice="opt">-v --value &lt;value&gt;</arg>
 
31
                <arg choice="opt">-P --params &lt;param=value[,param=value...]&gt;</arg>
 
32
                <arg choice="opt">-h --help</arg>
32
33
        </cmdsynopsis>
33
34
        
34
35
</refsynopsisdiv>
45
46
    <title>OPTIONS</title>
46
47
 
47
48
    <variablelist>
48
 
      <varlistentry><term><option>-C, --control-port=&lt;port&gt;</option></term>
 
49
      <varlistentry><term><option>-C, --control-port &lt;port&gt;</option></term>
49
50
        <listitem>
50
51
          <para>
51
52
            It is possible to run multiple concurrent instances of tgtd
55
56
        </listitem>
56
57
      </varlistentry>
57
58
 
58
 
      <varlistentry><term><option>-Y, --device-type=&lt;type&gt;</option></term>
 
59
      <varlistentry><term><option>-Y, --device-type &lt;type&gt;</option></term>
59
60
        <listitem>
60
61
          <para>
61
62
            When creating a LUN, this parameter specifies the type of device
70
71
    ssc     : same as tape
71
72
    cd      : emulate a DVD drive
72
73
    changer : emulate a media changer device
73
 
      </screen>
74
 
 
75
 
      <varlistentry><term><option>--lld [driver] --op new --mode target --tid=[id] --targetname [name]</option></term>
76
 
        <listitem>
77
 
          <para>
78
 
            Add a new target with [id] and [name].
79
 
          </para>
80
 
        </listitem>
81
 
      </varlistentry>
82
 
 
83
 
      <varlistentry><term><option>--lld [driver] --op delete --mode target --tid=[id]</option></term>
84
 
        <listitem>
85
 
          <para>
86
 
            Delete specific target with [id]. The target must have no active I_T nexus.
87
 
          </para>
88
 
        </listitem>
89
 
      </varlistentry>
90
 
 
91
 
      <varlistentry><term><option>--lld [driver] --op show --mode target</option></term>
 
74
    pt      : passthrough type to export a /dev/sg device
 
75
      </screen>
 
76
 
 
77
      <varlistentry><term><option>-E, --bstype &lt;type&gt;</option></term>
 
78
        <listitem>
 
79
          <para>
 
80
            When creating a LUN, this parameter specifies the type of backend storage
 
81
            to to use.
 
82
          </para>
 
83
        </listitem>
 
84
      </varlistentry>
 
85
      <screen format="linespecific">
 
86
Possible backend types are:
 
87
    rdwr    : Use normal file I/O. This is the default for disk devices
 
88
    aio     : Use Asynchronous I/O
 
89
    mmap    : Use memory mapping for the backend file
 
90
 
 
91
    sg      : Special backend type for passthrough devices
 
92
    ssc     : Special backend type for tape emulation
 
93
      </screen>
 
94
 
 
95
      <varlistentry><term><option>--lld &lt;driver&gt; --op new --mode target --tid &lt;id&gt; --targetname &lt;name&gt;</option></term>
 
96
        <listitem>
 
97
          <para>
 
98
            Add a new target with &lt;id&gt; and &lt;name&gt;.
 
99
          </para>
 
100
        </listitem>
 
101
      </varlistentry>
 
102
 
 
103
      <varlistentry><term><option>--lld &lt;driver&gt; --op delete --mode target --tid &lt;id&gt;</option></term>
 
104
        <listitem>
 
105
          <para>
 
106
            Delete specific target with &lt;id&gt;. The target must have no active I_T nexus.
 
107
          </para>
 
108
        </listitem>
 
109
      </varlistentry>
 
110
 
 
111
      <varlistentry><term><option>--lld &lt;driver&gt; --op show --mode target</option></term>
92
112
        <listitem>
93
113
          <para>
94
114
            Show all the targets.
96
116
        </listitem>
97
117
      </varlistentry>
98
118
 
99
 
      <varlistentry><term><option>--lld [driver] --op show --mode target --tid=[id]</option></term>
 
119
      <varlistentry><term><option>--lld &lt;driver&gt; --op show --mode target --tid &lt;id&gt;</option></term>
100
120
        <listitem>
101
121
          <para>
102
 
            Show target parameters of a target with [id].
 
122
            Show target parameters of a target with &lt;id&gt;.
103
123
          </para>
104
124
        </listitem>
105
125
      </varlistentry>
106
126
 
107
 
      <varlistentry><term><option>--lld [driver] --op new --mode=logicalunit --tid=[id] --lun=[lun] --backing-store [path]</option></term>
 
127
      <varlistentry><term><option>--lld &lt;driver&gt; --op new --mode logicalunit --tid &lt;id&gt; --lun &lt;lun&gt; --backing-store &lt;path&gt;</option></term>
108
128
        <listitem>
109
129
          <para>
110
 
            Add a new logical unit with [lun] to specific target with [id]. The
111
 
            logical unit is offered to the initiators. [path] must be block device
 
130
            Add a new logical unit with &lt;lun&gt; to specific target with &lt;id&gt;. The
 
131
            logical unit is offered to the initiators. &lt;path&gt; must be block device
112
132
            files (including LVM and RAID devices) or regular files. lun0 is
113
133
            reserved for a special device automatically created.
114
134
          </para>
115
135
        </listitem>
116
136
      </varlistentry>
117
137
 
118
 
      <varlistentry><term><option>--lld [driver] --op delete --mode=logicalunit --tid=[id] --lun=[lun]</option></term>
 
138
      <varlistentry><term><option>--lld &lt;driver&gt; --op delete --mode logicalunit --tid &lt;id&gt; --lun &lt;lun&gt;</option></term>
119
139
        <listitem>
120
140
          <para>
121
 
            Delete specific logical unit with [lun] that the target with [id] has.
 
141
            Delete specific logical unit with &lt;lun&gt; that the target with &lt;id&gt; has.
122
142
          </para>
123
143
        </listitem>
124
144
      </varlistentry>
125
145
 
126
 
      <varlistentry><term><option>--lld [driver] --op bind --mode=target --tid=[id] --initiator-address=[address]</option></term>
 
146
      <varlistentry><term><option>--lld &lt;driver&gt; --op bind --mode target --tid &lt;id&gt; --initiator-address &lt;address&gt;</option></term>
127
147
        <listitem>
128
148
          <para>
129
 
            Add the address to the access lists of the target with [id]. Initiators
 
149
            Add the address to the access lists of the target with &lt;id&gt;. Initiators
130
150
            with the address can access to the target. 'ALL' is a special address
131
151
            to allow all initiators to access to a target.
132
152
          </para>
133
153
        </listitem>
134
154
      </varlistentry>
135
155
 
136
 
      <varlistentry><term><option>--lld [driver] --op unbind --mode=target --tid=[id] --initiator-address=[address]</option></term>
137
 
        <listitem>
138
 
          <para>
139
 
            Delete the address from the access lists of the target with [id].
140
 
          </para>
141
 
        </listitem>
142
 
      </varlistentry>
143
 
 
144
 
      <varlistentry><term><option>--lld [driver] --op update --mode=target --tid=[id] --name=[parameter] --value=[value]</option></term>
145
 
        <listitem>
146
 
          <para>
147
 
            Change the value of [parameter] of the target with [id] to [value].
148
 
          </para>
149
 
        </listitem>
150
 
      </varlistentry>
151
 
 
152
 
      <varlistentry><term><option>--lld [driver] --op update --mode=target --tid=[id] --params parameter=value[,...]</option></term>
 
156
      <varlistentry><term><option>--lld &lt;driver&gt; --op unbind --mode target --tid &lt;id&gt; --initiator-address &lt;address&gt;</option></term>
 
157
        <listitem>
 
158
          <para>
 
159
            Delete the address from the access lists of the target with &lt;id&gt;.
 
160
          </para>
 
161
        </listitem>
 
162
      </varlistentry>
 
163
 
 
164
      <varlistentry><term><option>--lld &lt;driver&gt; --op update --mode target --tid &lt;id&gt; --name=&lt;parameter&gt; --value=&lt;value&gt;</option></term>
 
165
        <listitem>
 
166
          <para>
 
167
            Change the value of &lt;parameter&gt; of the target with &lt;id&gt; to &lt;value&gt;.
 
168
          </para>
 
169
        </listitem>
 
170
      </varlistentry>
 
171
 
 
172
      <varlistentry><term><option>--lld &lt;driver&gt; --op update --mode target --tid &lt;id&gt; --params parameter=value&lt;,...&gt;</option></term>
153
173
        <listitem>
154
174
          <para>
155
175
            Sets/changes the value of one or more parameters.
288
308
         --params mode_page=0x1c:0:10:8:0:0:0:0:0:0:0:0:0
289
309
      </screen>
290
310
 
 
311
      <varlistentry><term><option>readonly=&lt;0|1&gt;</option></term>
 
312
        <listitem>
 
313
          <para>
 
314
            This sets the read-only flag of a LUN. A read-only LUN will
 
315
            refuse any attempts to write data to it.
 
316
          </para>
 
317
          <para>
 
318
            This parameter only applies to DISK devices.
 
319
          </para>
 
320
        </listitem>
 
321
      </varlistentry>
 
322
 
 
323
      <screen format="linespecific">
 
324
tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 \
 
325
         --params readonly=1
 
326
      </screen>
291
327
 
292
328
    </variablelist>
293
329
  </refsect1>
372
408
 
373
409
 
374
410
# Create a target
375
 
tgtadm --lld iscsi --mode target --op new --tid 1 -T iqn.2007-03:virtual-dvd:`hostname`
 
411
tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2007-03:virtual-dvd:`hostname`
376
412
 
377
413
# Create a DVD drive and give it a nice name
378
414
# The dvd starts out without a backing store file, i.e. no disk loaded
379
 
tgtadm --op new --mode logicalunit --tid 1 --lun 1 -Y cd
 
415
tgtadm --op new --mode logicalunit --tid 1 --lun 1 --device-type cd
380
416
tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params vendor_id=STGT_DVD,product_id=DVD101,product_rev=0010,scsi_sn=STGTDVD01,removable=1
381
417
 
382
418
# We need a backend store file for the media changer
385
421
fi
386
422
 
387
423
# Create the SMC device and give it a nice name
388
 
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 -b $HOME/smc --device-type=changer
 
424
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 --backing-store $HOME/smc --device-type changer
389
425
tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params vendor_id=STK,product_id=L700,product_rev=0010,scsi_sn=XYZZY_0,removable=1
390
426
 
391
427
# Add a Data Transfer devices (1 drive)
416
452
tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1025,barcode=DISK_002,sides=1
417
453
 
418
454
# Allow ALL initiators to connect to this target
419
 
tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
 
455
tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL
420
456
 
421
457
# Show all our good work.
422
458
tgtadm --lld iscsi --mode target --op show
426
462
  </refsect1>
427
463
 
428
464
 
 
465
  <refsect1><title>Passthrough devices</title>
 
466
    <para>
 
467
      In addition to device emulation TGTD also supports utilizing existing SG devices on the host and exporting these through a special passthrough device type.
 
468
    </para>
 
469
    <varlistentry><term><option>--bstype=sg</option></term>
 
470
      <listitem>
 
471
        <para>
 
472
          This specifies that an SG devices is used.
 
473
        </para>
 
474
      </listitem>
 
475
    </varlistentry>
 
476
    <varlistentry><term><option>--device-type=pt</option></term>
 
477
      <listitem>
 
478
        <para>
 
479
          This specifies that passthrough device type is used.
 
480
        </para>
 
481
      </listitem>
 
482
    </varlistentry>
 
483
    <varlistentry><term><option>--backing-store=&lt;/dev/sg4&gt;</option></term>
 
484
      <listitem>
 
485
        <para>
 
486
          This specifies which device to export through TGTD.
 
487
        </para>
 
488
      </listitem>
 
489
    </varlistentry>
 
490
    <screen format="linespecific">
 
491
Example:
 
492
Make /dev/sg4 available to initiators connecting to TGTD.
 
493
 
 
494
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --bstype=sg --device-type=pt --backing-store=/dev/sg4
 
495
    </screen>
 
496
 
 
497
  </refsect1>
 
498
 
 
499
 
 
500
  <refsect1><title>Header Digest and Data Digest</title>
 
501
    <para>
 
502
      Header and data digests can be set on a per target parameter.
 
503
      TGTD supports two modes, None and CRC32C.
 
504
      When the digest is set to None, TDTD will negotiate that digests
 
505
      will not be used, and when CRC32C is set, TGTD will force the
 
506
      connection to use digest.
 
507
    </para>
 
508
 
 
509
    <refsect2><title>Viewing the current settings</title>
 
510
      <para>
 
511
        This command is used to view the current settings for header/data
 
512
        digest.
 
513
      </para>
 
514
      <screen format="linespecific">
 
515
tgtadm --op show --mode target --tid 1
 
516
  ...
 
517
  HeaderDigest=None
 
518
  DataDigest=None
 
519
  ...
 
520
      </screen>
 
521
    </refsect2>
 
522
    <refsect2><title>Setting digest</title>
 
523
      <screen format="linespecific">
 
524
Set header digest to CRC32C:
 
525
tgtadm --op update --mode target --tid 1 -n HeaderDigest -v CRC32C
 
526
 
 
527
Set data digest to None:
 
528
tgtadm --op update --mode target --tid 1 -n DataDigest -v None
 
529
      </screen>
 
530
    </refsect2>
 
531
  </refsect1>
 
532
 
 
533
 
 
534
 
 
535
 
429
536
  <refsect1><title>iSNS PARAMETERS</title>
430
537
    <para>
431
538
      iSNS configuration for a target is by using the tgtadm command.
443
550
      <screen format="linespecific">
444
551
Example:
445
552
 
446
 
tgtadm --op update --mode sys --name iSNSServerIP -v 192.168.11.133
 
553
tgtadm --op update --mode sys --name iSNSServerIP --value 192.168.11.133
447
554
      </screen>
448
555
 
449
556
      <varlistentry><term><option>iSNS</option></term>
456
563
      <screen format="linespecific">
457
564
Example:
458
565
 
459
 
tgtadm --op update --mode sys --name iSNS -v On
 
566
tgtadm --op update --mode sys --name iSNS --value On
460
567
      </screen>
461
568
 
462
569
      <varlistentry><term><option>iSNSServerPort</option></term>
469
576
      <screen format="linespecific">
470
577
Example:
471
578
 
472
 
tgtadm --op update --mode sys --name iSNSServerPort -v 3205
 
579
tgtadm --op update --mode sys --name iSNSServerPort --value 3205
473
580
      </screen>
474
581
 
475
582
      <varlistentry><term><option>iSNSAccessControl</option></term>
482
589
      <screen format="linespecific">
483
590
Example:
484
591
 
485
 
tgtadm --op update --mode sys --name iSNSAccessControl -v Off
 
592
tgtadm --op update --mode sys --name iSNSAccessControl --value Off
486
593
      </screen>
487
 
 
488
594
    </variablelist>
489
 
 
490
 
 
491
595
  </refsect1>
492
596
 
493
597