How to Make SCSI Logical Units Available

How to Make SCSI Logical Units Available

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 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 uses this method. This process includes the following steps:
    1. 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.
    2. 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.
    3. 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.
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)man page for more information on Target Groups.

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.

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.

  1. Obtain the Global Unique Identification (GUID) number for the logical unit.
    # sbdadm list-lu # stmfadm list-lu -v
    
  2. Add a view for the logical unit.
    # stmfadm add-view GUID_number
    

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) man page.

In the following task, steps 2-5 run on the target, while step 1 and steps 6-8 run on the host.

  1. 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.
    # fcinfo hba-port
    
    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
    
  2. For all configurations, create a Host Group.
    # stmfadm create-hg Host-A
    
  3. Specify the members for the Host Group, adding the WWNs as members.
    # stmfadm add-hg-member -g Host-A wwn.210000e08b83378d wwn.210100e08ba3378d
    
  4. 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.
    stmfadm list-target
    
  5. Create a Target Group.
    stmfadm create-tg Targets-0
    
  6. 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.
    stmfadm add-tg-member -g Targets-0 wwn.501000e092376af7
    
  7. Obtain the Global Unique Identification (GUID) number for the logical unit.
    # sbdadm list-lu
    

    or

    # stmfadm list-lu -v
    
  8. Export the logical unit by adding a view entry, specifying the host group name and the logical unit GUID number.
    # stmfadm add-view -h Host-A -t Targets-0 -n 1 GUID_number
    

    The initiators can now access the exported logical unit.

  9. 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.
    #!/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
    

    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.

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.

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.

Where to Go Next

Labels

task task Delete
smallsiteadmin smallsiteadmin Delete
configuring configuring Delete
storage storage Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


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