Creating an iSCSI LUN - FSx for ONTAP

Creating an iSCSI LUN

This process describes how to create an iSCSI LUN on an Amazon FSx for NetApp ONTAP scale-up file system using the NetApp ONTAP CLI lun create command. For more information, see lun create in the NetApp ONTAP Documentation Center.

Note

The iSCSI protocol isn't supported for scale-out file systems.

This process assumes you already have a volume created on your file system. For more information, see Creating volumes.

  1. To access the NetApp ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system by running the following command. Replace management_endpoint_ip with the IP address of the file system's management port.

    [~]$ ssh fsxadmin@management_endpoint_ip

    For more information, see Managing file systems with the ONTAP CLI.

  2. Create a LUN using the lun create NetApp CLI command, replacing the following values:

    • svm_name - The name of the storage virtual machine (SVM) providing the iSCSI target. The host uses this value to reach the LUN.

    • vol_name - The name of the volume hosting the LUN.

    • lun_name - The name you want to assign to the LUN.

    • size - The size, in bytes, of the LUN. The maximum size LUN you can create is 128 TB.

      Note

      We recommend that you use a volume at least 5% larger than your LUN size. This margin leaves space for volume snapshots.

    • ostype - The operating system of the host, either windows_2008 or linux. Use windows_2008 for all versions of Windows; this ensures the LUN has proper block offset for the operating system and optimizes performance.

    Note

    We recommend enabling space allocation on your LUN. With space allocation enabled, ONTAP can inform your host when the LUN is out of capacity and can reclaim space as you delete data from the LUN.

    For more information, see lun create in the NetApp ONTAP CLI documentation.

    > lun create -vserver svm_name -path /vol/vol_name/lun_name -size size -ostype ostype -space-allocation enabled
    Created a LUN of size 10g (10737418240)
  3. Confirm the LUN is created, online, and mapped.

    > lun show

    The system responds with the following output:

    Vserver Path State Mapped Type Size --------- ------------------------------- ------- -------- ------------ -------- svm_name /vol/vol_name/lun_name online unmapped windows_2008 10GB

Next steps

Now that you have created an iSCSI LUN, the next step in the process of using an iSCSI LUN as block storage is to map the LUN to an igroup. For more information, see Mounting iSCSI LUNs to a Linux client or Mounting iSCSI LUNs to a Windows client.