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.
Before you begin
Procedure
-
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.
-
Find the host NVMe Qualified Name (NQN) address (under
/etc/nvme/hostnqn). -
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 - Map relevant volumes to the NVMe host. The same volumes cannot be mapped concurrently to both NVMe and SCSI.
-
To discover and connect to NVMe targets, enter the following commands.
- The NVMe Discover command.
nvme discover --transport=fc --traddr=nn-0x$twwnn:pn-0x$twwpn --host-traddr=nn-0x$wwnn:pn-0x$wwpnThe 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 - 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 -
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
- The NVMe Discover command.
-
Newly created volumes are not visible to the host automatically due to missing support from the
namespace notifications asynchronous events feature. An NVMe controller is the path from the host to
the volumes. With efficient FC-NVMe multipath configuration, the host is able to route the I/O to
volumes through several controllers.
To display the new volumes to the host, run the reset command on a relevant NVMe controller. When you use the reset controller command, do not reset all controllers at once. To prevent loosing all paths from the host to the volumes, reset one controller at a time. Wait at least 60 seconds before you reset the next controller.
To find the list of controllers, run the following command on the host.- ls /dev/nvme* | grep -P 'nvme\d+$'