View Source

h2. Creating 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 that determines which interfaces a specific iSCSI target will listen to.

A TPG contains IP addresses and TCP port numbers. Use the {{itadm create-tpg}} command to create a TPG as a list of ip-address:port specifiers. A specific iSCSI target is bound to that TPG with 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 instance, 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.

h3. Using TPGs with iSER

When you use 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 IB interfaces could use SendTargets discovery 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 will correctly prefer using its IB-capable interface when connecting to target T.


{note:title=Tip}
Don't 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 LUN mapping. Each view entry specifies a target group, host group, and a LUN. See the [stmfadm(1M)|http://docs.sun.com/app/docs/doc/819-2240/stmfadm-1m?a=view] man page and [How to Make SCSI Logical Units Available] for more information on Target Groups and LUN mapping.{note}

h3. How to Set up a Target Portal Group for iSCSI Targets

To create a TPG, you provide a unique name and a Target Portal Group Tag (ranging from 2-65535) is automatically generated. Target Portal Group 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 instructions show you how to create two Target Portal Groups, TPGA and TPGB, that use port 8000 for the IP addresses in TPGB.
# Log in to the target as superuser.
# Create a TPG.
{code}
# itadm create-tpg TPGA 192.168.0.1 192.168.0.2
# itadm create-tpg TPGB 192.168.0.2:8000 192.168.0.2:8000
{code}
{info:title=Note}IPv4 portals are specified in dotted address notation (for example, 192.168.0.1). IPv6 portal addresses must be enclosed in square brackets.{info}
# Configure an existing iSCSI target to use Target Portal Groups TPGA and TPGB.
{code}
# itadm modify-target -t TPGA,TPGB eui.20387ab8943ef7548
{code}
# Verify the Target Portal Groups you created.
{code}
# itadm list-tpg -v
{code}
You can remove a TPG with the {{itadm delete-tpg}} command.

To learn about static and iSNS target discovery, see [Configuring an iSCSI Target for Discovery|http://wikis.sun.com/display/OpenSolarisInfo/Configuring an iSCSI Target for Discovery]. The iSCSI initiator uses the {{iscsiadm}} command to discover TPGs.

For more information on the {{itadm}} and {{iscsiadm}} commands, see the [{{iscsiadm.1m}}|http://docs.sun.com/app/docs/doc/819-2240/iscsiadm-1m?l=en&a=view&q=iscsiadm] and [{{itadm.1m}}|Configuring iSCSI-Based Authentication (Task Map)^itadm.1m.pdf] man pages.

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact