Skip to content

Target Discovery

Nareg Sinenian edited this page May 21, 2016 · 4 revisions

Targets may be discovered dynamically using iSCSI discovery or added manually (static configuration). Dynamic discovery will automatically add all targets found on a particular iSCSI node. Static discovery may be used instead to add specific targets on an iSCSI node.

Static Discovery

Targets may be manually added if the target's iSCSI Qualified Name (IQN) or unique identifier (EUI-64) are known, along with the address of the portal that can be used to access the target:

$ iscsictl add target <target,portal> [-interface <interface>]

The <target> argument is the iSCSI qualified name (e.g., iqn.2012-06.com.example:target0), while the <portal> is a valid IPv4/IPv6 address or valid DNS name of the discovery portal to use and may include an optional port (e.g., 192.168.1.10:3260). A default port of 3260 is assumed if one is not explicitly specified. If the specified target already exists, this command may be used to add additional portals to the target. An optional <interface> may be specified using the -interface switch to denote which interface to use (default) is the default value is an interface is not specified.

A list of discovered targets (either static or dynamic) associated portals can be obtained as follows:

$ iscsictl list targets
iqn.2012-06.com.example:target0 <inactive, static>
    192.168.1.10 <inactive, port 3260, interface default>

The state of each target and portal is displayed alongside the target configuration type, portal port and interface.

Examples

$ iscsictl add target iqn.2012-06.com.example:target0,192.168.1.10:3260
The specified target has been added

$ iscsictl add target iqn.2012-06.com.example:target0,192.168.1.50:3260
The specified portal has been added

Dynamic Discovery (iSCSI SendTargets)

This method uses the iSCSI discovery (SendTargets) on a discovery portal to find targets and their associated portals. Discovery portals can be added as follows:

$ iscsictl add discovery-portal <portal>

Once one or more discovery portals have been added, the SendTargets discovery method should be enabled:

$ iscsictl modify discovery-config -SendTargets enable

In addition, the discovery scan interval may be modified if desired. This interval (specified in seconds) determines how often the iSCSI daemon rescans the discovery portals for new targets:

$ iscsictl modify discovery-config -interval <interval>

The discovery configuration may be listed using:

$ iscsictl list discovery-config

This will display a list of discovery portals, specify whether discovery is enabled and indicate the discovery interval in seconds.

Examples

$ iscsictl add discovery-portal 192.168.1.10
The discovery portal 192.168.1.10 has been added

$ iscsictl modify discovery-config -interval 60
The discovery interval has been updated

$ iscsictl modify discovery-config -SendTargets enable
SendTargets discovery has been enabled

$ iscsictl list discovery-config
SendTargets: enabled
    interval 60
    discovery-portals: 1
        192.168.1.10  <port 3260, interface default>