... h2. How to Make SCSI Logical Units Available
{toc:type=list|minlevel=3|maxlevel=3}
Simply registering a logical unit with the STMF framework does not make it available to hosts (initiators) on the network. This section describes how to make logical units visible to initiator hosts for the following configurations.
For iSCSI, Fibre Channel, and FCoE configurations, a logical unit must be mapped before it can be accessed. You can choose one of the following methods, both of which use the {{stmfadm}} command: * *Simple mapping* exposes the logical unit to all initiators through all the ports, using one command. [How to Make a Logical Unit Available to All Hosts|#ggxtx] uses this method. * *Selective mapping* enables you to specify the hosts that can access the logical unit. [How to Make a Logical Unit Available to Selected Hosts|#ggaaa] uses this method. This process includes the following steps: *# Defining Host Groups - A Host Group is a name given to a set of hosts (initiators) that are allowed to access the same logical units. This step is not needed if the same set of logical units is visible to all the hosts, as in simple mapping. *# Defining Target Groups - A Target Group is a name given to a set of target ports that export the same set of logical units to the same set of Host Groups. This step is not needed if the same set of logical units is visible to all the hosts, as in simple mapping. |
*# Adding one or more views for each logical unit - Adding a view creates a bridge between the logical unit and the host initiator. When an initiator from the host group logs into a target port contained in the Target Group, the logical unit is visible.
|
| {note:title=Tip}Don't confuse a Target Group with a Target Portal Group (TPG). A TPG is a list of IP addresses that an iSCSI target listens to. A TPG can help you restrict an iSCSI target so that is it
available only through one specific IP address. See the
[stmfadm(1M)|http://docs.sun.com/app/docs/doc/819-2240/stmfadm-1m?a=view] man
page for more information on Target
Groups. See [How to Create a Target Portal Group] for more information on TPGs.{note} |
| |
| |
A view entry consists of four components: Host Group,Target Group, logical unit number (LUN), and logical unit identifier. Of these four components, only the logical unit identifier is required. If the other components are omitted, the following default values are assumed: * If the Host Group is omitted, the {{All Initiators}} value is assumed. |
... * If the Target Group is omitted, the {{All Targets}} value is assumed. * If the logical unit is omitted, the system chooses a suitable logical unit for the entry.
h3. {anchor:ggxtx} How to Make a Logical Unit Available to All Hosts
This procedure makes a logical unit available to all initiator hosts on a storage network.
|
# Obtain the Global Unique Identification (GUID) number for the logical unit. {code} |
| # sbdadm list-lu
# stmfadm list-lu -v |
| # stmfadm list-lu -v |
{code} # Add a view for the logical unit. |
... {code} # stmfadm add-view GUID_number {code}
h3. {anchor:ggaaa} How to Make a Logical Unit Available to Selected Hosts
This procedure makes the logical unit available to selected hosts on a storage network. If you use Fibre Channel ports, you first need to identify the World Wide Names (WWN). Then you selectively map a logical unit number (LUN) to the ports on Host-A. In these steps, a Host Group is used but not a Target Group because all the targets ports are available to the two host ports. The diagram below shows two Target Groups. For information on configuring a Target Group, see the [stmfadm(1M)|http://docs.sun.com/app/docs/doc/819-2240/stmfadm-1m?a=view] man page.
In the following task, steps 2-5 run on the target, while step 1 and steps 6-8 run on the host.
# Identify the host identifier of the initiator host you want to add to your view. Follow the instructions for each port provider to identify the initiators associated with each port provider. For example, for Fibre Channel, see [How to Configure Fibre Channel Ports]. {code:none} # fcinfo hba-port |
{code} {code:none} |
HBA Port WWN: *210000e08b83378d* OS Device Name: /dev/cfg/c4 Manufacturer: Qlogic Corp. Model: QLA2462 Firmware Version: 4.0.27 Fcode/BIOS Version: N/A Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 210000e08b83378d HBA Port WWN: *210100e08ba3378d* OS Device Name: /dev/cfg/c5 Manufacturer: Qlogic Corp. Model: QLA2462 Firmware Version: 4.0.27 Fcode/BIOS Version: N/A Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 210100e08ba3378d |
| HBA Port WWN: *210000e08b83378d* OS Device Name: /dev/cfg/c4 Manufacturer: Qlogic Corp. Model: QLA2462 Firmware Version: 4.0.27 Fcode/BIOS Version: N/A Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 210000e08b83378d HBA Port WWN: *210100e08ba3378d* OS Device Name: /dev/cfg/c5 Manufacturer: Qlogic Corp. Model: QLA2462 Firmware Version: 4.0.27 Fcode/BIOS Version: N/A Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 210100e08ba3378d |
{code} # For all configurations, create a Host Group. |
... {code:none} # stmfadm create-hg Host-A {code} # Specify the members for the Host Group, adding the WWNs as members. {code:none} |
# stmfadm add-hg-member -g Host-A wwn.210000e08b83378d wwn.210100e08ba3378d {code} |
| # Follow the instructions within each port provider to identify the name of each SCSI target you want to add to your view.
This step is optional if you want the logical unit to be available through all SCSI targets.
You can list the SCSI targets that are already available with {{stmfadm list-target}}. |
{code:none} stmfadm list-target |
... {code} # Create a Target Group. {code:none} |
stmfadm create-tg Targets-0 {code} |
| # Specify the members for the Target Group, adding the target names as members.
Each SCSI target can be a member of only one Target Group. |
{code:none} stmfadm add-tg-member -g Targets-0 wwn.501000e092376af7 |
... {code} # Obtain the Global Unique Identification (GUID) number for the logical unit. {code:none} # sbdadm list-lu {code} or {code:none} # stmfadm list-lu -v {code} # Export the logical unit by adding a view entry, specifying the host group name and the logical unit GUID number. {code:none} # stmfadm add-view -h Host-A -t Targets-0 -n 1 GUID_number {code} The initiators can now access the exported logical unit. # Verify that the logical unit is visible.
|
* For example, on a Solaris Fibre Channel initiator host, verify that the target logical unit is visible by running the following script. {code:none} |
| #!/bin/ksh
fcinfo hba-port |grep "^HBA" | awk '{print $4}' | while read 1n do fcinfo remote-port -p $1n -s >/dev/null 2>&1 done |
fcinfo hba-port |grep "^HBA" | awk '{print $4}' | while read 1n do fcinfo remote-port -p $1n -s >/dev/null 2>&1 done |
{code} All subsequent logical units appear in the format output because the script forces the initiator to touch all the logical units through all the ports. If the LUNs are not visible, run the {{format}} command again. If the LUNs are still not visible, ensure that the service is enabled on the target by using the {{svcs stmf}} command. Also ensure that you added view entries for the LUN, as described in this procedure. |
... * For a Linux initiator host, verify that the logical unit is visible by running the utility provided by the HBA vendor. The utility scans for configuration changes. * For a Windows initiator host, verify that the logical unit is visible by selecting Control Panel \-> Administrative Tools \-> Computer Management \-> Disk Management. Then from the Action menu, choose Rescan Disks.
h4. Example
The diagram shows how to use view entries to make logical unit A available to two hosts, Host-1 and Host-2. To accomplish this task, two view entries were added to logical unit A. !diagram2.jpg|align=center!
View entry 00 on logical unit A has Host Group set to Host-A, Target Group set to A_Ports and the logical unit number set to 0. This configuration allows Host-1 access to logical unit A. View entry 01 on logical unit A has Host Group set to Host-B, Target group set to A_Ports and logical unit number (LUN) set to 1. This configuration allows Host-2 access to logical unit A; however, Host-2 sees logical unit A as LUN 1.
h5. Where to Go Next
* [How to Configure Fibre Channel Ports|How to Configure Fibre Channel Ports] * [How to Configure FCoE Ports|How to Configure FCoE Ports] * [How to Configure iSCSI Ports|How to Configure iSCSI Target Ports] * [How to Configure SRP Ports|How to Enable the SRP Target Service] |