Skip to main content

Creating a LUN

You can use the lun create command to create a LUN. You can also use the igroup create command to create an igroup and map the LUN to the igroup, which enables the specified host to access the LUN.

Before you begin

  • There must be an aggregate with enough free space to contain the LUN.

  • There must be a storage virtual machine (SVM) with the iSCSI protocol enabled and the appropriate logical interfaces (LIFs) created.

  • You must have recorded the iSCSI initiator node name of the host.

  1. Connect IP-address-of-cluster-management-LIF in an ssh session and log in using your cluster administrator credential.
  2. Run the volume create command to create a volume on a specified SVM and storage aggregate.

    The following example creates a new volume named vol0 on a SVM named vs0 and a storage aggregate named aggr0_node1. Upon its creation, the volume is placed in the online state. The volume is 50 GB in size and the create operation runs in the background.

    DM-cluster::> volume create -vserver vs0 -volume vol0 -aggregate aggr0_node1 -size 50G -state online
  3. Run the lun create command to create a new LUN of a specific size. When you create a LUN, you must specify the LUN OS type.

    The following example creates a new LUN named lun0 with a size of 20 GB and OS type of Linux.

    DM-cluster::> lun create -vserver vs0 -volume vol0 -lun lun0 -size 20GB -ostype linux
  4. Run the igroup create command to create an initiator group (igroup) and map the LUN to the igroup, which enables the specified host to access the LUN.

    The following example creates an igroup (igroup0) that consists of one initiator for iSCSI.

    DM-cluster::> igroup create -vserver vs0 -igroup igroup0 -protocol iscsi -ostype linux -initiator iqn.1991-05.com.microsoft:eng1
  5. Run the lun map command the map your LUNs to the igroups.

    The following example maps LUN lun0 to igroup igroup0.

    DM-cluster::> lun map -vserver vs0 -volume vol0 -lun lun0 -igroup igroup0