OpenSolaris 2008.11 COMSTAR Administration Guide
Previous Next

Making a Logical Unit Available

Simply registering a logical unit with the STMF framework does not make it available to hosts (initiators) on the network. This section covers how to make logical units visible to initiator hosts for the following configurations.

For Fibre Channel configurations, a logical unit must be mapped before it can be accessed. You can choose between the following methods. Both use the stmfadm command:

  • Simple mapping exposes the logical unit to all initiators through all the ports, using one command. 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. To Make a Logical Unit Available to Selected Hosts uses this method. This process includes the following steps:

    1. Define 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 all the hosts will see the same set of logical units, as in simple mapping.

    2. Define 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 all the hosts will see the same set of logical units, as in simple mapping.

    3. Add one or more Views for each logical unit. Adding a view creates a bridge between the logical unit and the host initiator. When any of the initiators from the host group logs into a target port contained in the target group, it sees the logical unit.

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.

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

To Make a Logical Unit Available to Selected Hosts

This procedure makes the logical unit available to selected hosts on a storage network. First, you identify the WWNs for the Fibre Channel ports. Then you selectively map a logical unit number (LUN) to two Fibre Channel ports on Host-A. In this example, a Host group is used but not a Target group. This is because all the targets ports are available to the two host ports.


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


  1. Identify the WWNs for the fibre channel ports of the host.
    # 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. Create a host group.
    # stmfadm create-hg Host-A
  3. Specify the ports for the host group, adding the WWNs as members.
    # stmfadm add-hg-member -g Host-A wwn.210000e08b83378d www.210100e08ba3378d
  4. Obtain the Global Unique Identification (GUID) number for the logical unit.
    # sbdadm list-lu
    # stmfadm list-lu -v
  5. 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 -n 1 GUID_number

    The initiators should now be able to access the exported logical unit.

  6. Access the logical unit in one of the following ways:
    • For a Solaris initiator host, verify that the 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 you do not see the LUNs, run the format command again. If you still do not see the LUNs, 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 step 5 of this procedure.

    • For a Linux initiator host, verify that the logical unit is visible by running the utility that scans for configuration changes provided by the HBA vendor.

    • For a Windows initiator host, verify that the logical unit is visible by selecting Control Panel –> Administrative Tools –> Computer Management –> Disk Management. Then go to the Action menu and select Rescan Disks.

Previous Next