12–NVMe-oF Configuration with RDMA
Configuring the Target Server
189
AH0054601-00 B
Configuring the Target Server
You configure the target server after the reboot process. After the server is
operating, you cannot change the configuration without rebooting. If you are using
a startup script to configure the target server, consider pausing the script (using
the
wait
command or something similar) as needed to ensure that each
command finishes before executing the next command.
To configure the target service:
1.
Load target modules. Issue the following commands after each server
reboot:
# modprobe qedr
#
modprobe nvmet; modprobe nvmet-rdma
#
lsmod | grep nvme
(confirm that the modules are loaded)
2.
Create the target subsystem (NQN) with the name indicated by
<nvme-subsystem-name>
.
#
mkdir /sys/kernel/config/nvmet/subsystems/<nvme-subsystem-name>
#
cd /sys/kernel/config/nvmet/subsystems/<nvme-subsystem-name>
3.
Create multiple unique NQNs for additional NVMe devices as needed.
4.
Set the target parameters, as listed in
Table 12-1. Target Parameters
Command
Description
#
echo 1 > attr_allow_any_host
Allow any host to connect.
#
mkdir namespaces/1
Create a namespace
#
echo -n /dev/nvme0n1 >namespaces/
1/device_path
Set the NVMe device path. The NVMe device path
can differ between systems. Check the device path
using the
lsblk
command. This system has two
NVMe devices:
nvme0n1
and
nvme1n1
.
#
echo 1 > namespaces/1/enable
Enable the namespace.