2017-01-04 21:47:02 +00:00
|
|
|
# Getting Started Guide {#nvmf_getting_started}
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2016-08-04 20:18:12 +00:00
|
|
|
The NVMe over Fabrics target is a user space application that presents block devices over the
|
|
|
|
network using RDMA. It requires an RDMA-capable NIC with its corresponding OFED software package
|
|
|
|
installed to run. The target should work on all flavors of RDMA, but it is currently tested against
|
|
|
|
Mellanox NICs (RoCEv2) and Chelsio NICs (iWARP).
|
|
|
|
|
|
|
|
The NVMe over Fabrics specification defines subsystems that can be exported over the network. SPDK
|
|
|
|
has chosen to call the software that exports these subsystems a "target", which is the term used
|
|
|
|
for iSCSI. The specification refers to the "client" that connects to the target as a "host". Many
|
|
|
|
people will also refer to the host as an "initiator", which is the equivalent thing in iSCSI
|
|
|
|
parlance. SPDK will try to stick to the terms "target" and "host" to match the specification.
|
|
|
|
|
|
|
|
There will be both a target and a host implemented in the Linux kernel, and these are available
|
|
|
|
today as a set of patches against the kernel 4.8 release candidate. All of the testing against th
|
|
|
|
SPDK target has been against the proposed Linux kernel host. This means that for at least the host
|
|
|
|
machine, the kernel will need to be a release candidate until the code is actually merged. For the
|
|
|
|
system running the SPDK target, however, you can run any modern flavor of Linux as required by your
|
|
|
|
NIC vendor's OFED distribution.
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2017-01-04 21:47:02 +00:00
|
|
|
# Prerequisites {#nvmf_prereqs}
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2016-08-04 20:18:12 +00:00
|
|
|
This guide starts by assuming that you can already build the standard SPDK distribution on your
|
2016-08-08 23:35:11 +00:00
|
|
|
platform. By default, the NVMe over Fabrics target is not built. To build nvmf_tgt there are some
|
|
|
|
additional dependencies.
|
2016-06-06 23:32:22 +00:00
|
|
|
|
|
|
|
Fedora:
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~{.sh}
|
2016-06-06 23:32:22 +00:00
|
|
|
dnf install libibverbs-devel librdmacm-devel
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~
|
2016-06-06 23:32:22 +00:00
|
|
|
|
|
|
|
Ubuntu:
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~{.sh}
|
2016-06-06 23:32:22 +00:00
|
|
|
apt-get install libibverbs-dev librdmacm-dev
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2016-08-08 23:35:11 +00:00
|
|
|
Then build SPDK with RDMA enabled, either by editing CONFIG to enable CONFIG_RDMA or
|
2016-08-04 20:18:12 +00:00
|
|
|
enabling it on the `make` command line:
|
2016-06-08 23:34:15 +00:00
|
|
|
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~{.sh}
|
2016-07-13 22:34:28 +00:00
|
|
|
make CONFIG_RDMA=y <other config parameters>
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2016-08-04 20:18:12 +00:00
|
|
|
Once built, the binary will be in `app/nvmf_tgt`.
|
|
|
|
|
2017-01-04 21:47:02 +00:00
|
|
|
# Configuring NVMe over Fabrics Target {#nvmf_config}
|
2016-06-06 23:32:22 +00:00
|
|
|
|
2016-08-08 23:35:11 +00:00
|
|
|
A `nvmf_tgt`-specific configuration file is used to configure the NVMe over Fabrics target. This
|
2016-08-04 20:18:12 +00:00
|
|
|
file's primary purpose is to define subsystems. A fully documented example configuration file is
|
|
|
|
located at `etc/spdk/nvmf.conf.in`.
|
|
|
|
|
|
|
|
You should make a copy of the example configuration file, modify it to suit your environment, and
|
|
|
|
then run the nvmf_tgt application and pass it the configuration file using the -c option. Right now,
|
|
|
|
the target requires elevated privileges (root) to run.
|
|
|
|
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~{.sh}
|
2016-08-04 20:18:12 +00:00
|
|
|
app/nvmf_tgt/nvmf_tgt -c /path/to/nvmf.conf
|
2017-01-04 21:47:02 +00:00
|
|
|
~~~
|