Go to main content

Managing Devices in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Creating iSCSI Target Portal Groups

You can create a target portal group (TPG) to manage the discovery of multiple iSCSI and iSER targets. A TPG is a list of IP addresses to determine upon which interfaces a specific iSCSI target will listen.

A TPG contains IP addresses and TCP port numbers. To use this capability, you need to do the following:

  • Create a TPG as a list of ip-address:port specifiers by using the itadm create-tpg command.

  • Bind a specific iSCSI target to a TPG by using the itadm modify-target –t command.

  • When an iSCSI target is made active, an iSCSI listener is created for each IP address and port belonging to a TPG associated with that target.

A TPG is an efficient way to control which targets are discovered through specific ports. For example, you could restrict your iSCSI target so that it is available only through one specific IP address or only through a set of iSER-capable IP addresses.


Note -  Do not confuse target portal groups with target groups. A target group is a list of SCSI target ports that are all treated the same when creating views. Creating a view can help you facilitate LU mapping. Each view entry specifies a target group, a host group, and a LU. For more information about Target Groups and LUN mapping, see Making SCSI Logical Units Available and stmfadm(8).

To learn about static and iSNS target discovery, see Configuring Dynamic or Static Target Discovery. The iSCSI initiator uses the iscsiadm command to discover TPGs. For more information, see iscsiadm(8) and itadm(8).

Using TPGs with iSER

When you use the SendTargets discovery and iSER at the same time, a common convention is to use a TPG to associate a specific iSCSI target port with only iSER-capable IP addresses. For example, if a target system has four IP addresses, A, B, C, and D, and only addresses B and C are iSER-capable, then addresses B and C could be added to a TPG, and assigned to a target T.

An iSCSI initiator with both Ethernet and InfiniBand (IB) interfaces could use the SendTargets discovery method to discover the possible storage targets. Without the use of TPGs, the initiator might always prefer the use of the Ethernet interfaces over the IB interfaces. By associating target T only with the IB interfaces, the initiator correctly prefers using its IB-capable interface when connecting to target T.

How to Create a Target Portal Group for iSCSI Targets

You can create a target portal group (TPG) by providing a unique name, and a TPG Tag (ranging from 2–65535) is automatically generated. TPG Tag 1 is reserved for the default TPG that is used when you do not explicitly set a TPG on the target. The portal for the default TPG matches requests from all network interfaces on port 3260.

The following steps shows how to create two TPGs, TPGA and TPGB, that use port 8000 for the IP addresses in TPGB.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  2. Create two TPGs.
    target# itadm create-tpg TPGA 192.0.2.1 192.0.2.2
    target# itadm create-tpg TPGB 192.0.2.2:8000 192.0.2.2:8000

    Note -  IPv4 portals are specified in dotted address notation (for example, 192.0.2.1). IPv6 portal addresses must be enclosed in square brackets.
  3. Configure an existing iSCSI target to use the TPGs, TPGA and TPGB.
    # itadm modify-target -t TPGA,TPGB eui.20387ab8943ef7548
  4. Verify the TPGs that you created.
    # itadm list-tpg -v

    You can remove a TPG with the itadm delete-tpg command.