Library Table of Contents Index Previous Next Comments

Creating LUNs and initiator groups using individual commands

When to use individual commands  Top

There are several ways you can combine individual commands to create a LUN. The following table steps you through the basics.

To make a LUN accessible to the host, you must create an initiator group and map the LUN to the initiator group. For FCP, when the initiator HBA was installed in the host and the host was brought online on the SAN, its WWPN was registered with the switch's Fabric Name Service. You can see what initiators are available to add to an initiator group by using the fcp show initiator. For iSCSI, use the iscsi show initiator command.

The following table starts with this step.

To do this...

Use this command...

Display the unique identifiers of the initiators that are available to create initiator groups

fcp show initiator

Sample result

Initiators connected on adapter 4a:
Portname                   Group
10:00:00:00c:2b:cc:92
10:00:00:00c:2b:cc:35
10:00:00:00c:2b:4d:f6
10:00:00:00c:2b:6b:38

OR

iscsi show initiator

Sample result

Initiators connected on adapter iswta:
     Tgt_PG  iSCSI Initiator Name / ISID
        2    iqn.1986-03.com.intel:rtpqa-intel-2:hba-1 / 
40:00:02:da:00:02

Determine which hosts are associated with the WWPNs

To determine which WWPN is associated with a host, use the NetApp-supplied commands you downloaded from the CD-ROM in the HBA kit, such as sanlun for Solaris hosts or lputilnt for Windows hosts. See the HBA installation and setup guide for your host for instructions about how to use the commands.

Alternatively, if you recorded the IEEE address of the initiator (host) HBA, you can obtains its WWPN by prepending the address with "10:00".

Create an initiator group

igroup create { -f | -i } -t ostype groupname unique identifier

-f indicates that the initiator group contains Fibre Channel WWPNs, written as 16 hexadecimal characters.

-i indicates that the initiator group contains iSCSI nodenames.

-t indicates that the operating system type follows.

ostype is the name of the operating system of the initiator: default, solaris, or windows. If default is selected, the initiator group can contain initiators with different types of operating systems.

groupname is the name you specify as the name of the initiator group.

unique identifier is either

  • WWPN, which is the 64-bit address of the initiator's port name.
  • iSCSI nodename, which is a string of characters defined as follows:

    iqn.yyyy-mm.backward_naming_authority:unique_device_name

    yyyy-mm is the year and month in which the naming authority acquired the domain name.

    backward_naming_authority is the reverse domain name of the entity responsible for naming this device. For example, com.netapp.

    unique_device_name is the unique name for this device assigned by the naming authority.

Example

igroup create -f -t solaris solaris-igroup3 10:00:00:00c:2b:cc:92

Create a LUN

lun create -s size -t ostype lunname 

-s indicates the size of the LUN to be created, in bytes by default. You can use one of the following characters to multiply the size: c (bytes), w (words or double bytes), b (512), k (kilobytes), m (megabytes), g (gigabytes), t (terabytes).

-t indicates that the operating system type follows.

ostype values are image (default), which indicates that the contents of the LUN are not specified; solaris, which indicates that the LUN will store a Solaris raw disk in a single-slice partition; or windows, which indicates that the LUN will store a raw disk device in a single-partition Windows disk.

lunname is the LUN's path name that includes the volume and qtree.

Example

lun create -s 4g -t solaris /vol/vol1/qtree1/lun3
Result

A 4-GB LUN called /vol/vol1/qtree1/lun3 is accessible by a Solaris host.

In general, when you format and partition LUNs as a disk on a host, the size of the disk is smaller due to the overhead required by the host.

Map the LUN to an initiator group

lun map lunname initiator-group-name [LUN-ID]

lunname is the path name of the LUN you created.

initiator-group-name is the name of the initiator group you created.

LUN-ID is the identification number that you specify the initiator should use when the LUN is mapped to it. The range of the number depends on the operating system of the initiator:

  • For Solaris, the range is 0-4096.
  • For Windows, the range is 0-254.
Example 1

lun map /vol/vol1/qtree1/lun3 solaris-igroup3 0

Result

Data ONTAP maps /vol/vol1/qtree1/lun3 to the initiator group solaris-igroup3 at LUN ID 0.

Example 2

lun map /vol/vol1/lun0 solaris-igroup0

Result

Data ONTAP assigns the next lowest valid LUN ID to map the LUN to the initiator group. After entering the command in this example, Data ONTAP displays the following message:

lun map: auto-assigned solaris-igroup0=0

Display the LUNs you created

lun show [-v|-m] [all|mapped|offline|online|unmapped|lun-path|-g 
initiator-group]
Example
lun show -v
Sample result

/vol/vol1/qtree1/lun3    4g (4294967296)   (r/w, online, mapped)
        Serial#: 0dCfh3bgaBTU
        Share: none
        Space Reservation: enabled
        Multiprotocol Type: solaris
        Maps: solaris-igroup0=0

Display the LUN ID mapping

lun show -m

Sample result

 
LUN path                Mapped to                LUN ID
----------------------------------------------------
/vol/vol1/lun0           solaris-igroup0          0
/vol/vol1/lun1           solaris-igroup1          0
/vol/vol1/qtree1/lun2    solaris-igroup2          0
/vol/vol1/qtree1/lun3    solaris-igroup3          0

In this example, each LUN is mapped to a different initiator group, which was named to reflect the host whose WWPN was used when creating the initiator group. Note that the LUN ID mapping begins with 0 for each initiator group. If a second LUN is mapped to the same initiator group, the LUN ID automatically increments by one.

Library Table of Contents Index Previous Next Comments