TARGETS.CONF(5) [FIXME: manual] TARGETS.CONF(5) NAME targets.conf - Linux SCSI Target Configuration File DESCRIPTION tgt-admin uses /etc/tgt/targets.conf to initialize tgtd configuration, by default. Its layout uses a HTML-like structure, with a hierarchy of nested tags to define targets and LUNs. CONFIGURATION FILE SYNTAX Global directives configure options that are global to tgtd's configuration, as well as defining exported targets, via target sections. Target sections contain directives specific to one target device. They define each target's exported LUNs via "backing-store" and "direct-store" directives, as well as other target-wide options. LUN directives ("backing-store" and "direct-store") may contain options specific to a single exported logical unit. GLOBAL DIRECTIVES With the exception of target directives, each of these should occur at most once. > Defines a the start of a target definition. IQN is an ISCSI Qualified Name such as "iqn.2001-04.com.example:storage1". Within this block should be target-level directives, as documented below. The target definition ends with "" default-driver Instead of specifying a driver type for each target, default-driver defines a default low-level driver for all exported targets. It may be overriden on a per-target basis. Valid lld values are "iscsi" or "iser". Since iscsi is assumed if this directive is not present, it is only generally needed if iser is the desired default. include Include the configuration from another configuration file. Wildcards are allowed, so an example like "include /etc/tgt/xen/*.conf" is allowed. ignore-errors yes Errors from tgtadm will be ignored. Default is no. control-port Define a different local socket key for communicating with tgtd. Defaults to 0. This is only generally useful if multiple instances of tgtd are in use. iSNSServerIP Define the address of the iSNS server in IPv4 dotted-quad address format. Required when using iSNS, otherwise ignored. iSNSAccessControl Set iSNS access control. Valid values are "On" or "Off". Required when using iSNS, otherwise ignored. iSNSServerPort Set a different iSNS server port. Default is 3205. Optional when using iSNS, otherwise ignored. iSNS On Enable iSNS. Only valid value is "On". Default is off. incomingdiscoveryuser Define iscsi incoming discovery authentication setting. If no value is given, no authentication is performed. outgoingdiscoveryuser Define iscsi outgoing discovery authentication setting. If no value is given, no authentication is performed. TARGET-LEVEL DIRECTIVES Each target may export multiple block devices, or logical units (LUNs). For the purposes of LUN numbering, backing-store directives are processed before direct-store directives. backing-store Defines a logical unit (LUN) exported by the target. This may specify either a regular file, or a block device. direct-store Defines a direct mapped logical unit (LUN) with the same properties as the physical device (such as VENDOR_ID, SERIAL_NUM, etc.) driver Define the low-level driver to use for this target, either "iscsi" or "iser" (without quotes). This overrides the "default-driver" global directive. initiator-address Allows connections only from the specified IP address. Defaults to ALL if no initiator-address directive is specified. initiator-name Allows connections only from the specified initiator name. incominguser Define iscsi incoming authentication setting. If no "incominguser" is specified, it is not used. This directive may be used multiple times per target. outgoinguser Define iscsi outgoing authentication setting. If no "outgoinguser" is specified, it is not used. This directive may be used multiple times per target. controller_tid Define the tid of the controller. Default is next available integer. LUN-LEVEL DIRECTIVES All of these may be listed at the target level (and apply to all LUNs) or within an individual LUN's definition, if it is defined using the container-style, multi-line definition, rather than single-line definition format: # LUN directives go here # LUN directives go here It is recommended to use either single-line or container-style LUN definitions within a target. Mixing styles can cause parser errors. write-cache "on" or "off", default on. scsi_id scsi_sn vendor_id product_id product_rev sense_format removable path mode_page readonly device-type bs-type allow-in-use block-size Specify the block size for this LUN. lbppbe Specify the Logical blocks per physical block exponent. By default TGTD will set the lbppbe to automatically match the underlying filesystem. Use this parameter to override that setting. This is an internal option that should not be set directly. la_lba Specify the lowest aligned logical block address. This is an internal option that should not be set directly. optimal_xfer_gran Specify the optimal transfer granularity, to be reflected in the Block Limits VPD. This is an internal option that should not be set directly. optimal_xfer_len Specify the optimal transfer length, to be reflected in the Block Limits VPD. This is an internal option that should not be set directly. params Pass additional parameters to tgtadm. CONFIGURATION FILE EXAMPLE Example configuration file: backing-store /dev/san/monitoring # if no "incominguser" is specified, it is not used incominguser backup secretpass12 # defaults to ALL if no "initiator-address" is specified initiator-address 192.168.1.2 backing-store /dev/san/xen1-disk1 # LUN1 direct-store /dev/san/xen1-disk2 # LUN2 initiator-address 192.168.1.2 # Allowed IP initiator-address 192.168.5.6 # Allowed IP incominguser user1 secretpass12 incominguser user2 secretpass23 outgoinguser userA secretpassA backing-store /dev/san/xen2 backing-store /dev/san/vmware1 FILES /etc/tgt/targets.conf Configuration file for tgt-admin. /usr/share/doc/tgt/targets.conf.example Example configuration file for tgt-admin. SEE ALSO tgtd(8), tgtadm(8), tgtimg(8), tgt-setup-lun(8). https://github.com/fujita/tgt REPORTING BUGS Report bugs to [FIXME: source] 09/05/2024 TARGETS.CONF(5)