Difference between revisions of "TGT iSCSI Target"

From ArchWiki
Jump to: navigation, search
(translation from dutch to english)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category: Storage]]
+
[[Category:Storage]]
{{i18n|TGT iSCSI Target}}
+
[[nl:TGT iSCSI Target]]
 +
{{Poor writing|Dutch article is the original, English is not my native language.}}
  
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|Installation and configuration of TGT as iSCSI target }}
 
{{Article summary text|Installation and configuration of TGT as iSCSI target }}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
{{Article summary wiki|ISCSI_Target}}
+
{{Article summary wiki|iSCSI Target}}
 
{{Article summary wiki|iSCSI Boot}}
 
{{Article summary wiki|iSCSI Boot}}
 
{{Article summary end}}
 
{{Article summary end}}
 
{{Bad translation|Dutch article is the original, english is not my native language}}
 
  
 
The [http://stgt.sourceforge.net TGT SCSI framework] can be used for several storage protocols. This document describes the usage of TGT as iSCSI target.
 
The [http://stgt.sourceforge.net TGT SCSI framework] can be used for several storage protocols. This document describes the usage of TGT as iSCSI target.
Line 15: Line 14:
 
==Why TGT==
 
==Why TGT==
  
There are several different iSCSI targets for Linux avalaible, with more or less the same performance. TGT has the following advantages:
+
There are several different iSCSI targets for Linux available, with more or less the same performance. TGT has the following advantages:
  
 
* active development
 
* active development
Line 23: Line 22:
  
 
The {{AUR|tgt}} software must be deployed from [[AUR]].  
 
The {{AUR|tgt}} software must be deployed from [[AUR]].  
If you want to use the direct store, then sg3_utils must be deployed from <nowiki>[</nowiki>[[extra]]<nowiki>]</nowiki> repository.
+
If you want to use the direct store, then sg3_utils must be deployed from the <nowiki>[</nowiki>[https://www.archlinux.org/packages/?sort=&repo=Extra extra]<nowiki>]</nowiki> repository.
Using direct-store, the properties of the physical device will be avalaible for the initiator and target.
+
Using direct-store, the properties of the physical device will be available for the initiator and target.
  
 
Please notice, if you're using a [[Firewall]], tcp port 3260 should be open.
 
Please notice, if you're using a [[Firewall]], tcp port 3260 should be open.
Line 32: Line 31:
 
The configuration can be done:
 
The configuration can be done:
  
* using the {{ic|tgtadm}} utility, afterwards you can use {{ic|tgt-admin --dump}} to save the configuration. <br> You can find this method in the [http://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide Scsi-target-utils Quickstart Guide], as linked from the [http://stgt.sourceforge.net TGT website]. Unfortunaly the bad thing about this method is that not all parameters will be stored in the configuration file.
+
* using the {{ic|tgtadm}} utility, afterwards you can use {{ic|tgt-admin --dump}} to save the configuration. <br> You can find this method in the [http://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide Scsi-target-utils Quickstart Guide], as linked from the [http://stgt.sourceforge.net TGT website]. Unfortunately the bad thing about this method is that not all parameters will be stored in the configuration file.
 
* editing the /etc/tgt/targets.conf file.
 
* editing the /etc/tgt/targets.conf file.
  
Line 56: Line 55:
 
  MaxOutstandingR2T=1
 
  MaxOutstandingR2T=1
 
  MaxCommands=128
 
  MaxCommands=128
+
 
 
In the first part of this example, /dev/sdb will be offered as lun 12 and chap authentication is configured.  
 
In the first part of this example, /dev/sdb will be offered as lun 12 and chap authentication is configured.  
 
In the second part are some [http://www.ietf.org/rfc/rfc3720.txt iSCSI advanced parameters]
 
In the second part are some [http://www.ietf.org/rfc/rfc3720.txt iSCSI advanced parameters]
Line 65: Line 64:
  
 
  sudo rc.d start tgt
 
  sudo rc.d start tgt
+
 
 
If you want to start TGT during the boot process of Arch Linux, add tgt in the [[DAEMONS]] area of the [[rc.conf]] file.
 
If you want to start TGT during the boot process of Arch Linux, add tgt in the [[DAEMONS]] area of the [[rc.conf]] file.
  
 
  DAEMONS = ( ... network tgt ... )
 
  DAEMONS = ( ... network tgt ... )
+
 
You can check of everything works like expected:
+
You can check if everything works like expected:
  
 
  tgt-admin -s
 
  tgt-admin -s
 +
 +
== See also ==
 +
* [https://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide Quickstart Guide for STGT for Fedora]
 +
* [http://wpkg.org/TGT-admin Configuration File Guide]

Revision as of 16:14, 13 June 2012

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Dutch article is the original, English is not my native language. (Discuss in Talk:TGT iSCSI Target#)
Template:Article summary start

Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

The TGT SCSI framework can be used for several storage protocols. This document describes the usage of TGT as iSCSI target.

Why TGT

There are several different iSCSI targets for Linux available, with more or less the same performance. TGT has the following advantages:

  • active development
  • the only iSCSI target that can be used for vSphere environments

Installation

The tgtAUR software must be deployed from AUR. If you want to use the direct store, then sg3_utils must be deployed from the [extra] repository. Using direct-store, the properties of the physical device will be available for the initiator and target.

Please notice, if you're using a Firewall, tcp port 3260 should be open.

Configuration

The configuration can be done:

  • using the tgtadm utility, afterwards you can use tgt-admin --dump to save the configuration.
    You can find this method in the Scsi-target-utils Quickstart Guide, as linked from the TGT website. Unfortunately the bad thing about this method is that not all parameters will be stored in the configuration file.
  • editing the /etc/tgt/targets.conf file.

Example configuration

<target iqn.2004-01.nl.xtg:iscsi-server1>
 direct-store /dev/sdb
 write-cache on
 initiator-address ALL
 incominguser user password
 scsi_id 00010001
 vendor_id XTG
 lun 12
</target>
MaxRecvDataSegmentLength 131072
MaxXmitDataSegmentLength 131072
MaxBurstLength 262144
FirstBurstLength 262144
TargetRecvDataSegmentLength=262144
InitiatorRecvDataSegmentLength=262144
MaxOutstandingUnexpectedPDUs=0
MaxOutstandingR2T=1
MaxCommands=128

In the first part of this example, /dev/sdb will be offered as lun 12 and chap authentication is configured. In the second part are some iSCSI advanced parameters

Start

If the configuration is well done, TGT can be started:

sudo rc.d start tgt

If you want to start TGT during the boot process of Arch Linux, add tgt in the DAEMONS area of the rc.conf file.

DAEMONS = ( ... network tgt ... )

You can check if everything works like expected:

tgt-admin -s

See also