Creating LUN in NetApp Using CLI
Creating LUN in NetApp Using CLI
If you want to create a LUN (Logical Unit Number) on a vfiler in NetApp, you will be forced to use CLI
commands. There is no wizard GUI tool for vfilers at least for now.
To carve up a storage space in NetApp to be presented to a SPARC Solaris machine using iSCSI
HBA, I used the following steps:
1. Configure iSCSI HBA on Solaris (i.e., configure IP address, netmask, gateway, vlan tagging [it if its
on a separate vlan], etc)
2. Login through NetApp console or remote session.
3. Go to the vfiler
nas3240> vfiler context vfiler-iscsi
4. Determine which volume to create the LUN. Make sure it has enough space.
nas3240@vfiler-iscsi> vol status
nas3240@vfiler-iscsi> df -h
5. Create qtree. I usually create the LUN on qtree level instead of volume. This makes my structure
cleaner.
nas3240@vfiler-iscsi> qtree create /vol/iscsi_apps/solaris
6. Create the LUN using this syntax: lun create -s size -t ostype lun_path
nas3240@vfiler-iscsi> lun create -s 200g -t solaris /vol/iscsi_apps/solaris/lun0
Successful execution of this command wil create LUN /vol/iscsi_apps/solaris/lun0 with a size of
200GB, and space-reserved. For LUN, the best practice is to thick provision (space-reserved), so
you wont have problems when the storage runs out of space.
7. Create initiator group or igroup which contain the IQN for the solaris host. Initiate a iscsi login
command from solaris host, and NetApp will see the IQN number. This IQN number will appear on
the console and you can cut and paste that number. Use this syntax to create igroup: igroup create -i
-t ostype initiator_group iqn_from_host
nas3240@vfiler-iscsi> igroup create -i -t solaris solaris_group iqn.200004.com.qlogic.gs2342345.2
8. Map the LUN to the host using igroup you created. Use this syntax: lun
maplun_path initiator_group [lun_id] where: lun_path is the path name of the LUN you
created,initiator_group is the name of the igroup you created, and lun_id is the identification number
that the initiator uses when the LUN is mapped to it. If you do not enter a number, Data ONTAP
generates the next available LUN ID number.
nas3240@vfiler-iscsi> lun map /vol/iscsi_apps/solaris/lun0 solaris_group
9. Verify LUN list and their mapping.
nas3240@vfiler-iscsi> lun show -m
LUN path
Mapped to
LUN ID Protocol
vol/iscsi_apps/solaris/lun0
solaris_group
2
iSCSI
10. Go to solaris box, and do iSCSI refresh. Check that it can see the LUN disk that has been
provisioned.