Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Creating LUNs and igroups using individual commands

When to use individual commands  Top

The commands in the following table occur in a logical sequence for creating LUNs and igroups for the first time. However, you can use the commands in any order, or you can skip a command if you already have the information that a particular command displays.

For more information about all of the options for these commands, see the online man pages. For information about how to view man pages, see Command-line administration.

To do this...

Use this command...

Display the node names of the initiators that are available to create igroups

iscsi show initiator

Sample result

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

Determine which hosts are associated with the node names

To determine the node name that is associated with a host, use the command or method provided by the vendor-supplied software that came with the SAN HBA kit, such as the Intel PRO/1000 T IP Storage Adapter for Windows hosts or the vendor-supplied iSCSI host initiator software, such as the iSCSI Microsoft Windows Initiator Support Kit.

Create an igroup

igroup create -i -t ostype initiator_group [node]

-i indicates that the igroup contains iSCSI node names.

-t ostype indicates the operating system of the initiator. The values are: default, solaris, windows, hpux, aix, or linux.

For more information about specifying the ostype of an igroup, see The name of the igroup.

initiator_group is the name you specify as the name of the igroup.

node is an iSCSI nodename

Example

igroup create -i -t windows windows-igroup3 iqn.1991-05.com.microsoft:lab1.hq.XYZcompany.com

Create a LUN

lun create -s size -t ostype lun_path 

-s indicates the size of the LUN to be created, in bytes by default. For information about LUN size, see The size of the LUN.

-t ostype indicates the operating system type that determines the geometry used to store data on the LUN. The values are image (default), solaris, windows, hpux, aix, and linux. For information about specifying the ostype of the LUN, see The host operating system type.

For information about specifying the LUN ostype, see The host operating system type.

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

Example

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

Result

A 4-GB LUN called /vol/vol1/qtree1/lun3 is accessible by a Windows 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 igroup

lun map lun_path igroup-name [LUN-ID]

lun_path is the path name of the LUN you created.

igroup-name is the name of the igroup 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 information about valid LUN ID ranges for your host initiator, see the documentation provided with your iSCSI host Initiator Support Kit or with your SAN Host Attach Kit for iSCSI Protocol on your host.

Example 1

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

Result

Data ONTAP maps /vol/vol1/qtree1/lun3 to the igroup windows-igroup3 at LUN ID 0.

Example 2

lun map /vol/vol1/lun0 windows-igroup3

Result

Data ONTAP assigns the next lowest valid LUN ID to map the LUN to the igroup.

After entering the command in this example, Data ONTAP displays the following message:

lun map: auto-assigned windows-igroup3=0

Display the LUNs you created

lun show -v

-v provides additional information, such as the comment string, serial number, and LUN mapping.

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: windows
        Maps: windows-igroup3=0

Display the LUN ID mapping

lun show -m

Sample result


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

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

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments