iscsitarget中的/etc/iet/iet.conf配置详解

来源:互联网 发布:斗鱼抢票软件官方网址 编辑:程序博客网 时间:2024/05/29 16:58
# Example iscsi target configuration## Everything until the first target definition belongs# to the global configuration.## "iSNSServer" is the iSNS server you want your portal to register# with.## "iSNSAccessControl" is for enabling initiator access control# through the iSNS server.## "IncomingUser" specifies credentials the initiator has to provide -# several of these are supported. If mutual CHAP shall be employed,# "OutgoingUser" specifies the user/pass combination the target will# provide - only one is supported.## Leave them alone (keep them commented out) if you don't want to use# authentication for discovery sessions.#iSNSServer 192.168.1.16#iSNSAccessControl No#IncomingUser joe secret#OutgoingUser jack 12charsecret# Targets definitions start with "Target" and the target name.# The target name must be a globally unique name, the iSCSI# standard defines the "iSCSI Qualified Name" as follows:## iqn.yyyy-mm.[:identifier]## "yyyy-mm" is the date at which the domain is valid and the identifier# is freely selectable. For further details please check the iSCSI spec.#Target选项必须以Target头,Target的名字以:iqn.yyyy-mm.[:identifier]的形式存在#其中iqn是iscsi固定格式,yyyy-mm为域名生效日期,identifier可选。  #Target iqn.2001-04.com.example:storage.disk2.sys1.xyz# CHAP Users## The same rules as for discovery users apply here.## Don't set them if you don't want to use CHAP authentication.##IncomingUser joe secret#OutgoingUser jim 12charpasswd## Logical Unit definition## Block devices, regular files (fileio only), LVM, and RAID# can be offered to the initiators as a block device.## Lun numbers MUST start with zero (each target needs a Lun 0)##Lun 0 Path=/dev/sdc,Type=fileio,ScsiId=xyz,ScsiSN=xyz#Lun必须是从0开始# Alias name for this target (Not Used)##Alias Test## Various iSCSI parameters# (not all are used right now, see also iSCSI spec for details)## Outgoing SCSI data (initiator to target user data or command# parameters) is sent as either solicited data or unsolicited data.# Solicited data is sent in response to R2T PDUs.  Unsolicited data# can be sent as part of an iSCSI command PDU sequence# ("Immediate Data") or as a separate iSCSI data PDU sequence.##MaxConnections1# Number of connections/session# We only support 1#MaxSessions0# Number of sessions/target# 0 = no explicit limit#InitialR2TYes# Wait first for R2T# Yes = no unsolicited data#ImmediateDataYes# Data can accompany command# Yes = cmnd/data in same PDU#MaxRecvDataSegmentLength 8192# Max data per PDU to receive#MaxXmitDataSegmentLength 8192# Max data per PDU to transmit#MaxBurstLength262144# Max data per sequence (R2T)#FirstBurstLength65536# Max unsolicited data sequence#DefaultTime2Wait2# Secs wait for ini to log out# Not used#DefaultTime2Retain20# Secs keep cmnds after log out# Not used#MaxOutstandingR2T1# Max outstanding R2Ts per cmnd#DataPDUInOrderYes# Data in PDUs is ordered# We only support ordered#DataSequenceInOrderYes# PDUs in sequence are ordered# We only support ordered#ErrorRecoveryLevel0# We only support level 0#HeaderDigestNone,CRC32C# PDU header checksum algo list# None or CRC32C# If only one is set then the# initiator must agree to it# or the connection will fail#DataDigestNone,CRC32C# PDU data checksum algo list# Same as above#MaxSessions0# Maximum number of sessions to# this target - 0 = unlimited#NOPInterval0# Send a NOP-In ping each after# that many seconds if the conn# is otherwise idle - 0 = off#NOPTimeout0 # Wait that many seconds for a# response on a NOP-In ping# If 0 or > NOPInterval, NOPInterval# is used!## Various target parameters##Wthreads8# Number of IO threads (IO线程数)#QueuedCommands32# Number of queued commands (队列命令数)

ietd.conf各选详细说明:

GLOBAL OPTIONS

Global Options are case sensitive.

[IncomingUser <username> <password>]
The <username> and <password> used during discovery sessions to authenticate iSCSI initiators. Several of those can be specified for discovery. If noIncomingUser is specified, any initiator is allowed to open a discovery session.
HINT: RFC 3720 requires <password> to be 12 characters long. This is enforced e.g. by MS Initiator.
[OutgoingUser <username> <password>]
The <username> and <password> used during discovery sessions to authenticate the target to initiators. Only one outgoing<username>/<password> combination may be specified.
HINT: RFC 3720 requires <password> to be 12 characters long. This is enforced e.g. by MS Initiator.
Target iqn.<yyyy-mm>.<tld.domain.some.host>[:<identifier>]
A target definition and the target name. The targets name (the iSCSI Qualified Name ) must be a globally unique name (as defined by the iSCSI standard) and has to start withiqn followed by a single dot. The EUI-64 form is not supported. <yyyy-mm> is the date (year and month) at which the domain is valid. This has to be followed by a single dot and the reversed domain name. The optional<identifier> – which is freely selectable – has to be separated by a single colon. For further details please check the iSCSI spec.Here is an example:

Target iqn.2004-07.com.example.host:storage.disk2.sys1.xyz

TARGET OPTIONS

Target options are also case sensitive.

[IncomingUser <username> <password>]
The <username> and <password> used to authenticate the iSCSI initiators to this target. It may be different from the username and password in section GLOBAL OPTIONS, which is used for discovery. If you omit theIncomingUser Option, connections are allowed without authentication. A<password> has to be provided, if there is a <username> given. Specifying several differentIncomingUser accounts is supported.
[OutgoingUser <username> <password>]
The <username> and <password> used to authenticate this iSCSI target to initiators. Only oneOutgoingUser per target is supported. It may be different from the username and password in section GLOBAL OPTIONS, which is used for discovery. A<password> has to be provided, if there is a <username> given.

Lun <lun> Type=(fileio|blockio),Path=<device>[,ScsiId=<scsi_id>][,ScsiSN=<scsi_sn>][,IOMode=(wb|ro|wt)][,BlockSize=<size>]
Lun <lun> Type=nullio[,Blocks=<count>][,BlockSize=<size>]
Parameters after <lun> should not contain any blank space characters except the first blank space after <lun> is needed.
The value of <lun> can be from 0 to 16384. The first <lun> defined MUST be 0.
In fileio mode (default), it defines a mapping between a “Logical Unit Number”<lun> and a given device <device> , which can be any block device (including regular block devices like hdX and sdX and virtual block devices like LVM and Software RAID devices) or regular files.
In blockio mode, it defines a mapping between a “Logical Unit Number” <lun> and a given block device <device>. This mode will perform direct block i/o with the device, bypassing page-cache for all operations. This allows for efficient handling of non-aligned sector transfers (virtualized environments) and large block transfers (media servers). This mode works ideally with high-end storage HBAs and for applications that either do not need caching between application and disk or need the large block throughput.
A ScsiId can be specified to assign a unique SCSI ID (VPD 0×83) to an iSCSI volume. This is used by initiator hosts to uniquely identify a SCSI volume. This is necessary with multipath-aware hosts accessing the same<device> through multiple iSCSI sessions. The <scsi_id> must not exceed 16 characters.
Also a ScsiSN can be specified to assign a unique serial number (VPD 0×80) to an iSCSI volume. This is used by certain initiator hosts (e.g. VMware ESX) to uniquely identify a SCSI volume. This is essential when used in conjunction with VMware ESX hosts accessing the same <device> through multiple iSCSI sessions. The <scsi_sn> must not exceed 16 characters.
By default LUNs are writable, employing write-through caching. By setting IOMode to “ro” a LUN can be set to read only mode. SettingIOMode to “wb” will enable write-back caching of a LUN. Setting IOMode to “wt” is only symbolic as that is the default behavior.
NOTE: IOMode “wb” is ignored when employing blockio as it performs no caching.
WARNING: IOMode=wb could lead to serious data loss from an unexpected system failure (power loss, system crash). Use at your own risk!
You can specify a logical BlockSize for an iSCSI volume. This <size> must be one of (512, 1024, 2048, 4096). IfBlockSize isn’t specified the default is 512 bytes for fileio, and the logical block size of the lower level device for blockio (which typically is 512 bytes).
NOTE: For blockio, you CANNOT specify a BlockSize less than the lower level device’s logical block size which is the minimum size the device can handle. An error will be reported and the LUN will fail to attach if you try. You CAN use fileio though to export a LUN with a BlockSize less than the lower level device’s logical block size.
WARNING: Once your data is written at a given BlockSize you cannot change this BlockSize without risking corruption of your existing data.
In nullio mode, it defines a mapping between a “Logical Unit Number” <lun> and an unnamed virtual device with a specified number of Blocks ofBlockSize bytes. If Blocks is not specified then it will default to 64GB’s worth given the curentBlockSize which defaults to 512 bytes. This is ONLY useful for performance measurement purposes. All writes to this virtual device will be discarded and all reads will return random data.
WARNING: By sending random kernel memory over the IP network you can potentially expose sensitive information.
[Alias <aliasname>]
This assigns an optional <aliasname> to the target.
[HeaderDigest <CRC32C|None>]
Optional. If set to “CRC32C” and the initiator is configured accordingly, the integrity of an iSCSI PDU’s header segments will be protected by a CRC32C checksum. The default is “None”. Note that header digests are not supported during discovery sessions.
[DataDigest <CRC32C|None>]
Optional. If set to “CRC32C” and the initiator is configured accordingly, the integrity of an iSCSI PDU’s data segment will be protected by a CRC32C checksum. The default is “None”. Note that data digests are not supported during discovery sessions.
[MaxConnections <value>]
Optional. The number of connections within a session. Has to be set to “1″ (in words: one), which is also the default since MC/S is not supported.
[MaxSessions <value>]
Optional. The maximum number of sessions for this target. If this is set to 0 (wich is the default) there is no explicit session limit.
[InitialR2T <Yes|No>]
Optional. If set to “Yes” (default), the initiator has to wait for the target to solicit SCSI data before sending it. Setting it to “No” allows the initiator to send a burst ofFirstBurstLength bytes unsolicited right after and/or (depending on the setting ofImmediateData ) together with the command. Thus setting it to “No” may improve performance.
[ImmediateData <Yes|No>]
Optional. This allows the initiator to append unsolicited data to a command. To achieve better performance, this should be set to “Yes”. The default is “No”.
[MaxRecvDataSegmentLength <value>]
Optional. Sets the maximum data segment length that can be received. The <value> should be set to multiples of PAGE_SIZE. Currently the maximum supported value is 64 * PAGE_SIZE, e.g. 262144 if PAGE_SIZE is 4kB. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is 8192.
[MaxXmitDataSegmentLength <value>]
Optional. Sets the maximum data segment length that can be sent. The <value> actually used is the minimum ofMaxXmitDataSegmentLength and the MaxRecvDataSegmentLength announced by the initiator. The<value> should be set to multiples of PAGE_SIZE. Currently the maximum supported value is 64 * PAGE_SIZE, e.g. 262144 if PAGE_SIZE is 4kB. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is 8192.
[MaxBurstLength <value>]
Optional. Sets the maximum amount of either unsolicited or solicited data the initiator may send in a single burst. Any amount of data exceeding this value must be explicitly solicited by the target. The<value> should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is 262144.
[FirstBurstLength <value>]
Optional. Sets the amount of unsolicited data the initiator may transmit in the first burst of a transfer either with and/or right after the command, depending on the settings ofInitialR2T and ImmediateData <value> should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is 65536.
[DefaultTime2Wait <value>]
Currently not supported.
[DefaultTime2Retain <value>]
Currently not supported.
[MaxOutstandingR2T <value>]
Optional. Controls the maximum number of data transfers the target may request at once, each of up toMaxBurstLength bytes. The default is 1.
[DataPDUInOrder <Yes|No>]
Optional. Has to be set to “Yes” – which is also the default.
[DataSequenceInOrder <Yes|No>]
Optional. Has to be set to “Yes” – which is also the default.
[ErrorRecoveryLevel <value>]
Optional. Has to be set to “0″ (in words: zero), which is also the default.
[NOPInterval <value>]
Optional. If value is non-zero, the initiator will be “ping”ed during phases of inactivity (i.e. no data transfers) everyvalue seconds to verify the connection is still alive. If the initiator fails to respond withinNOPTimeout seconds, the connection will be closed.
[NOPTimeout <value>]
Optional. If a non-zero NOPInterval is used to periodically “ping” the initiator during phases of inactivity (i.e. no data transfers), the initiator must respond withinvalue seconds, otherwise the connection will be closed. If value is set to zero or if it exceedsNOPInterval , it will be set to NOPInterval.
[Wthreads <value>]
Optional. The iSCSI target employs several threads to perform the actual block I/O to the device. Depending on your hardware and your (expected) workload, the number of these threads may be carefully adjusted. The default value of 8 should be sufficient for most purposes.
[QueuedCommands <value>]
Optional. This parameter defines a window of commands an initiator may send and that will be buffered by the target. Depending on your hardware and your (expected) workload, thevalue may be carefully adjusted. The default value of 32 should be sufficient for most purposes
可以参考:http://techthrob.com/2009/03/07/iscsi-101-setting-up-a-simple-iscsi-storage-area-network/
原创粉丝点击