Configuring the Linux operating system for FC-NVMe hosts

After you ensure that your system meets the requirements for attaching to a Linux host, configure the Linux operating system.

You must install the appropriate host bus adapters with the correct firmware and driver levels that support FC-NVMe.

  1. Zone the host ports to the NVMe ports on the system.

    For more information about how to identify NVMe ports on the system, see the CLI host commands.

  2. Find the host NVMe Qualified Name (NQN) address (under /etc/nvme/hostnqn).
  3. On the system, create the NVMe host object by using the host NQN.
    svctask mkhost -nqn nqn.2014-08.org.nvmexpress:uuid:449f8291-9c1e-446c-95c1-0942f55fa208
     -protocol nvme -name mcr-host-246
  4. Map relevant volumes to the NVMe host. The same volumes cannot be mapped concurrently to both NVMe and SCSI.
  5. To discover and connect to NVMe targets, enter the following commands.
    1. The NVMe Discover command.
      nvme discover --transport=fc --traddr=nn-0x$twwnn:pn-0x$twwpn 
      --host-traddr=nn-0x$wwnn:pn-0x$wwpn
      The return of this command is the NVMe Discover log page, which consists of the target's subsystem NQN.
      Discovery Log Number of Records 1, Generation counter 0
      =====Discovery Log Entry 0======
      trtype:  fibre-channel
      adrfam:  fibre-channel
      subtype: nvme subsystem
      treq:    not required
      portid:  <>
      trsvcid: none
      subnqn:  nqn.1986-03.com.ibm:nvme:2145.<>.iogroup<>
      traddr:  nn-$twwnn:pn-0x$twwpn
    2. The NVMe Connect command, which has the same syntax with the addition of the subnqn from step 5.a.
      nvme connect --transport=fc --traddr=nn-0x$twwnn:pn-0x$twwpn 
      --host-traddr=nn-0x$wwnn:pn-0x$wwpn -n $subnqn
    3. NVMe connect-all includes the Discover and Connect commands within the same command. This command connects automatically to the subnqn that is presented in the discover command:
      nvme connect-all --transport=fc --traddr=nn-0x$twwnn:pn-0x$twwpn 
      --host-traddr=nn-0x$wwnn:pn-0x$wwpn

Removing a LUN

To remove a LUN from the storage system, perform the following steps:
Attention: Before removing a LUN from the storage system, ensure that all processes and applications that access the LUN are stopped and nothing is accessing one or more storage systems. If any process is still accessing the removed LUN, an emergency shutdown may occur, resulting in loss of access.
  1. Stop all files access to the LUN, which needs to be removed and unmount the files system, if applicable.
    If LVM was used on one or more storage systems from which the LUN is being removed, make sure that no Logical Volumes, Volume Groups or Physical Volumes are still present or in use of one or more relevant storage systems. To ensure the above function, run the following commands:
    • man lvremove
    • man remove
    • man pvremove
  2. To verify that all files are closed, enter the lsof/dev/nvme*n* commands. The output must be empty.
  3. Place the LUNs on the storage side. From the storage system, unmap the volume from the host that uses the GUI.
    1. From the left-side panel, open the Hosts tab.
    2. Right-click on the hostname and select Modify Volume Mappings.
    3. Select the volume to be unmapped and click Remove Volume Mapping.