Default variables: configuration¶
debops.tgt default variables have more extensive configuration than
simple strings or lists, here you can find documentation and examples for them.
This is a list of iSCSI Targets configured on the host. Each iSCSI Target can
have multiple backing stores with custom configuration. Examples of options
which can be passed to the
tgt configuration can be found in
List of recognized iSCSI Target parameters:
- Required. Target name, added after
tgt_iqn_basestring, used also as the filename of the configuration file in
item.filenameis not specified.
- Alternative name of the configuration file.
- Custom IQN string used instead of the default one.
tgtoptions added to a given target, in YAML text block format.
- List of volumes present in a given iSCSI Target (see below).
- List of "passthrough" volumes present in a given iSCSI Target (see below).
- If present and
True, this iSCSI Target configuration will be removed from the configuration directory; if a given target is not used at the moment of deletion, it will also be removed from the server.
To provide a given volume through iSCSI, you need to specify it in a given
target as either a
direct-stre. Direct stores read
some metadata from storage devices and are more suited to export real hardware
storage media, backing stores are more suited to export logical volumes, block
devices or files.
To configure a set of stores, you can specify them directly in
tgt_targets: - name: 'hostname.data' options: | backing-store /dev/sdc backing-store /dev/sdd
There are also available separate lists,
direct_stores. Using these, you can specify a YAML list of block devices or
files to add to the iSCSI Target:
tgt_targets: - name: 'hostname.data' backing_stores: [ '/dev/sdc', '/dev/sdd' ]
If you need to specify additional per-store options, you can specify them as dicts instead:
tgt_targets: - name: 'hostname.data' backing_stores: - store: '/dev/sdc' options: | lun 1 - store: '/dev/sdd' options: | lun 2
Warning: you need to make sure to only use one of these definition types in
an iSCSI Target, ie. either a simple list of stores or a list of dicts which
define stores. Never mix them, otherwise the
tgt configuration parser won't
be able to correctly parse the configuration files.