Skip to main content
SAN hosts and cloud clients

NVMe/FC Host Configuration for Oracle Linux 8.1 with ONTAP

Contributors netapp-ranuk ciarm netapp-pcarriga netapp-aoife

You can configure NVMe over Fibre Channel (NVMe/FC) on initiator hosts running Oracle Linux 8.1 and ONTAP as the target.

Supportability

NVMe/FC is supported on ONTAP 9.6 or later for Oracle Linux 8.1. The Oracle Linux 8.1 host can run both NVMe and SCSI traffic through the same fibre channel (FC) initiator adapter ports. Note that the Broadcom initiator can serve both NVMe/FC and FCP traffic through the same FC adapter ports. See the Hardware Universe for a list of supported FC adapters and controllers. For the most current list of supported configurations see the NetApp Interoperability Matrix.

Note You can use the configuration settings provided in this document to configure cloud clients connected to Cloud Volumes ONTAP and Amazon FSx for ONTAP.

Known limitations

  • Native NVMe/FC auto-connect scripts are not available in the nvme-cli package. Use the HBA vendor provided external auto-connect scripts.

  • By default, round-robin load balancing is not enabled in NVMe Multipath. You must write a udev rule to enable this functionality. Steps are provided in the section on Enabling NVMe/FC on Oracle Linux 8.1.

  • There is no sanlun support for NVMe/FC and, as a consequence, no Linux Unified Host Utilities (LUHU) support for NVMe/FC on Oracle Linux 8.1. Use the ONTAP command output available as part of the NetApp plug-in included in the native nvme-cli.

  • SAN booting using the NVMe-oF protocol is currently not supported.

Enable NVMe/FC

  1. Install Oracle Linux 8.1 on the server.

  2. After the installation is complete, verify that you are running the supported Unbreakable Enterprise kernel. See the NetApp Interoperability Matrix.

    # uname -r
    5.4.17-2011.0.7.el8uek.x86_64
  3. Upgrade the nvme-cli package.

    # rpm -qa | grep nvmefc
    nvmefc-connect-12.6.61.0-1.noarch
  4. Add the string below as a separate udev rule at /lib/udev/rules.d/71-nvme-iopolicy-netapp-ONTAP.rules. This enables round-robin load balancing for NVMe multipath.

    # cat /lib/udev/rules.d/71-nvme-iopolicy-netapp-ONTAP.rules
    # Enable round-robin for NetApp ONTAP
    ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin"
  5. On the Oracle Linux 8.1 host, check the host NQN string at /etc/nvme/hostnqn and verify that it matches the host NQN string for the corresponding subsystem on the ONTAP array.

    # cat /etc/nvme/hostnqn
    nqn.2014-08.org.nvmexpress:uuid:75953f3b-77fe-4e03-bf3c-09d5a156fbcd
    *> vserver nvme subsystem host show -vserver vs_nvme_10
    Vserver Subsystem Host NQN
    ------- --------- ----------------------------------------------------------
    Oracle Linux_141_nvme_ss_10_0
    nqn.2014-08.org.nvmexpress:uuid:75953f3b-77fe-4e03-bf3c-09d5a156fbcd

    If the hostnqn strings do not match, you should use the vserver modify command to update the host NQN string on your corresponding ONTAP array subsystem to match to host NQN string from etc/nvme/hostnqn on the host.

  6. Reboot the host.

Configure the Broadcom FC Adapter for NVMe/FC

  1. Verify that you are using the supported adapter. For the most current list of supported adapters, see the NetApp Interoperability Matrix.

    # cat /sys/class/scsi_host/host*/modelname
    LPe32002-M2
    LPe32002-M2
    # cat /sys/class/scsi_host/host*/modeldesc
    Emulex LightPulse LPe32002-M2 2-Port 32Gb Fibre Channel Adapter
    Emulex LightPulse LPe32002-M2 2-Port 32Gb Fibre Channel Adapter
  2. NVMe support in lpfc is already enabled by default:

    # cat /sys/module/lpfc/parameters/lpfc_enable_fc4_type
    3

    Newer lpfc drivers (both inbox and outbox) have lpfc_enable_fc4_type default set to 3. Therefore, you do not need to set this explicitly in the /etc/modprobe.d/lpfc.conf.

  3. Next, install the recommended lpfc auto-connect scripts:

    # rpm -ivh nvmefc-connect-12.6.61.0-1.noarch.rpm
  4. Verify that the auto-connect scripts are installed.

    # rpm -qa | grep nvmefc
    nvmefc-connect-12.6.61.0-1.noarch
  5. Verify that the initiator ports are up and running.

    # cat /sys/class/fc_host/host*/port_name
    0x10000090fae0ec61
    0x10000090fae0ec62
    
    # cat /sys/class/fc_host/host*/port_state
    Online
    Online
  6. Verify that the NVMe/FC initiator ports are enabled and able to see the target ports, and all are up and running.

    In the example below, only a single initiator port has been enabled and connected with two target LIFs as seen in the below output:

    # cat /sys/class/scsi_host/host*/nvme_info
    
    NVME Initiator Enabled
    XRI Dist lpfc0 Total 6144 NVME 2947 SCSI 2947 ELS 250
    NVME LPORT lpfc0 WWPN x10000090fae0ec61 WWNN x20000090fae0ec61 DID x012000 ONLINE
    NVME RPORT WWPN x202d00a098c80f09 WWNN x202c00a098c80f09 DID x010201 TARGET DISCSRVC ONLINE
    NVME RPORT WWPN x203100a098c80f09 WWNN x202c00a098c80f09 DID x010601 TARGET DISCSRVC ONLINE

Validate NVMe/FC

  1. Verify the following NVMe/FC settings.

    # cat /sys/module/nvme_core/parameters/multipath
    Y
    # cat /sys/class/nvme-subsystem/nvme-subsys*/model
    NetApp ONTAP Controller
    NetApp ONTAP Controller
    # cat /sys/class/nvme-subsystem/nvme-subsys*/iopolicy
    round-robin
    round-robin

    In the above example, two namespaces are mapped to the Oracle Linux 8.1 ANA host. These are visible through four target LIFs: two local node LIFs and two other partner/remote node LIFs. This setup shows as two ANA Optimized and two ANA Inaccessible paths for each namespace on the host.

  2. Verify that the namespaces are created.

    # nvme list
    Node                SN                                           Model                                       Namespace Usage                              Format          FW Rev
    -------------------- --------------------------------------  ---------------------------------------- ----------------  -------------------------------  ----------------  -------------
    /dev/nvme0n1  814vWBNRwfBCAAAAAAAB NetApp ONTAP Controller        2                  107.37 GB / 107.37 GB  4 KiB + 0 B   FFFFFFFF
    /dev/nvme0n2  814vWBNRwfBCAAAAAAAB NetApp ONTAP Controller        3                  107.37 GB / 107.37 GB  4 KiB + 0 B   FFFFFFFF
  3. Verify the status of the ANA paths.

    # nvme list-subsys /dev/nvme0n1
    nvme-subsys0 - NQN=nqn.1992-08.com.netapp:sn.5a32407351c711eaaa4800a098df41bd:subsystem.test
    \
    +- nvme0 fc traddr=nn-0x207300a098dfdd91:pn-0x207400a098dfdd91 host_traddr=nn-0x200000109b1c1204:pn-0x100000109b1c1204 live optimized
    +- nvme1 fc traddr=nn-0x207300a098dfdd91:pn-0x207600a098dfdd91 host_traddr=nn-0x200000109b1c1204:pn-0x100000109b1c1204 live inaccessible
    +- nvme2 fc traddr=nn-0x207300a098dfdd91:pn-0x207500a098dfdd91 host_traddr=nn-0x200000109b1c1205:pn-0x100000109b1c1205 live optimized
    +- nvme3 fc traddr=nn-0x207300a098dfdd91:pn-0x207700a098dfdd91 host_traddr=nn-0x200000109b1c1205:pn-0x100000109b1c1205 live inaccessible
  4. Verify the NetApp plug-in for ONTAP devices.

    # nvme netapp ontapdevices -o column
    Device   Vserver  Namespace Path             NSID   UUID   Size
    -------  -------- -------------------------  ------ ----- -----
    /dev/nvme0n1   vs_nvme_10       /vol/rhel_141_vol_10_0/ol_157_ns_10_0    1        55baf453-f629-4a18-9364-b6aee3f50dad   53.69GB
    
    # nvme netapp ontapdevices -o json
    {
       "ONTAPdevices" : [
       {
            Device" : "/dev/nvme0n1",
            "Vserver" : "vs_nvme_10",
            "Namespace_Path" : "/vol/rhel_141_vol_10_0/ol_157_ns_10_0",
             "NSID" : 1,
             "UUID" : "55baf453-f629-4a18-9364-b6aee3f50dad",
             "Size" : "53.69GB",
             "LBA_Data_Size" : 4096,
             "Namespace_Size" : 13107200
        }
    ]

Enable 1MB I/O size for Broadcom NVMe/FC

ONTAP reports an MDTS (Max Data Transfer Size) of 8 in the Identify Controller data. This means the maximum I/O request size can be up to 1MB. To issue I/O requests of size 1 MB for a Broadcom NVMe/FC host, you must increase the lpfc value of the lpfc_sg_seg_cnt parameter to 256 from the default value of 64.

Note The following steps don't apply to Qlogic NVMe/FC hosts.
Steps
  1. Set the lpfc_sg_seg_cnt parameter to 256:

    cat /etc/modprobe.d/lpfc.conf
    Example output
    options lpfc lpfc_sg_seg_cnt=256
  2. Run the dracut -f command, and reboot the host:

  3. Verify that lpfc_sg_seg_cnt is 256:

    cat /sys/module/lpfc/parameters/lpfc_sg_seg_cnt

    The expected value is 256.