Skip to content

Commit 1a924d3

Browse files
committed
docs: add requirements for running with ANA
Document the prerequisites for Asymmetric Namespace Access (ANA), including rebuilding the kernel for NixOS.
1 parent f652a5f commit 1a924d3

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

doc/run.md

+38-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It will also need at least 512 2 MB Hugepages configured.
1818

1919
> Learn more about hugepages: [parts 1][hugepages-lwn-one], [2][hugepages-lwn-two],
2020
> [3][hugepages-lwn-three], [4][hugepages-lwn-four], [5][hugepages-lwn-five].
21-
21+
2222
In NixOS:
2323

2424
```nix
@@ -78,7 +78,7 @@ In order to use the full feature set of Mayastor, some or all of the following c
7878
+ `nvme_loop`: NVMe Loop Device support
7979

8080
To load these on NixOS:
81-
81+
8282
```nix
8383
# /etc/nixos/configuration.nix
8484
boot.kernelModules = [
@@ -91,7 +91,40 @@ In order to use the full feature set of Mayastor, some or all of the following c
9191
```bash
9292
modprobe nbd nvmet nvmet_rdma nvme_fabrics nvme_tcp nvme_rdma nvme_loop
9393
```
94-
* An NVMe device. (Typically via PCI-E through an standard slot or [M.2][m-dot-2] port)
94+
* For Asymmetric Namespace Access (ANA) support (early preview), the following kernel build configuration enabled:
95+
+ `CONFIG_NVME_MULTIPATH`: enables support for multipath access to NVMe subsystems
96+
97+
This is usually already enabled in distributions kernels, at least for RHEL/CentOS 8.2, Ubuntu 20.04 LTS, and SUSE Linux Enterprise 15.2.
98+
99+
On some distributions such as RHEL 8, the feature must be enabled manually:
100+
101+
```sh
102+
# /etc/modprobe.d/nvme-multipath
103+
options nvme_core multipath=1
104+
```
105+
106+
followed by reloading the `nvme-core` module or rebooting.
107+
108+
To build this on NixOS:
109+
110+
```nix
111+
# /etc/nixos/configuration.nix
112+
boot.kernelPackages = pkgs.linuxPackages;
113+
boot.kernelPatches = [ {
114+
name = "nvme-multipath";
115+
patch = null;
116+
extraConfig = ''
117+
NVME_MULTIPATH y
118+
'';
119+
} ];
120+
```
121+
122+
followed by:
123+
124+
```sh
125+
sudo nixos-rebuild boot
126+
```
127+
* An NVMe device. (Typically via PCI-E through a standard slot or [M.2][m-dot-2] port)
95128
* A version of [`nix`][nix-install] configured as in the [build guide.][doc-build]
96129

97130
## Running binaries directly
@@ -158,7 +191,7 @@ Why these parameters?
158191
- `--privileged` to allow controlling memory policies.
159192

160193
> **TODO:** We can use [control groups][control-groups] for this!
161-
- `-v /dev:/dev:rw` is needed to get access to any raw device you might want to consume as local
194+
- `-v /dev:/dev:rw` is needed to get access to any raw device you might want to consume as local
162195
storage and huge pages
163196
- `-v /dev/shm:/dev/shm:rw` is needed as for a circular buffer that can trace any IO operations
164197
as they happen
@@ -184,7 +217,7 @@ nixpkgs.overlays = [
184217
];
185218
186219
systemd.services.mayastor = {
187-
wantedBy = [ "multi-user.target" ];
220+
wantedBy = [ "multi-user.target" ];
188221
after = [ "network.target" ];
189222
description = "A cloud native declarative data plane.";
190223
serviceConfig = {
@@ -273,4 +306,3 @@ production Mayastor deployment and operation instructions.
273306
[lxd]: https://linuxcontainers.org/
274307
[libvirtd]: https://libvirt.org/index.html
275308
[terraform-readme]: ./terraform/readme.adoc
276-
[aarch64-branch]:

0 commit comments

Comments
 (0)