Skip to content

Commit b4790e4

Browse files
Add documentation for RAID devices
Signed-off-by: Matt Richerson <matthew.richerson@hpe.com>
1 parent 79f695b commit b4790e4

4 files changed

Lines changed: 112 additions & 0 deletions

File tree

docs/guides/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* [Directive Breakdown](directive-breakdown/readme.md)
1919
* [User Interactions](user-interactions/readme.md)
2020
* [System Storage](system-storage/readme.md)
21+
* [Redundant Allocations](redundant-allocations/readme.md)
2122

2223
## NNF User Containers
2324

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
authors: Matt Richerson <matt.richerson@hpe.com>
3+
categories: provisioning
4+
---
5+
6+
# Redundant Allocations
7+
8+
## Background
9+
10+
Lustre, XFS, and Raw allocations can be created using a redundant configuration either through zpools or LVM. This guide documents how these configurations might be used.
11+
12+
## Creating a Redundant Allocation
13+
14+
An allocation may choose to use a redundant configuration to allow access to data even when a drive has failed. In addition, rebuild commands can be specified to allow a new drive to be added to the RAID.
15+
16+
The [Storage Profiles](../storage-profiles/readme.md) section details the command lines needed to create an allocation using a RAID device.
17+
18+
## Rebuilding a Redundant Allocation
19+
20+
Choosing whether to allow a redundant allocation to be rebuilt with a new drive depends on the file system and allocation type.
21+
22+
### LVM
23+
24+
For XFS and Raw allocations using LVM, the RAID device can only be rebuilt when the Rabbit node has the LV activated. For `jobdw` allocations, this means that the RAID cannot be rebuilt while the compute nodes have the LV activated between `PreRun` and `PostRun`. For this reason, the most common way to use RAID configurations in this situation will be without rebuilding enabled.
25+
26+
If an XFS or Raw allocation is made with `create_persistent`, then the rebuild commands should be specified to allow the RAID to be rebuilt when no compute nodes have the LV activated.
27+
28+
### Zpool
29+
30+
For Lustre allocations using zpool, there are no restrictions on when rebuild commands can be used. The RAID can be rebuilt for job and persistent instances regardless of whether the compute nodes have the file system mounted.
31+
32+
### Replacing a Drive
33+
34+
If a drive has failed and needs to be replaced, the Rabbit-p and Rabbit-s should be powered off to replace the drive. After powering the Rabbit back on, the `nnf-node-manager` pod will restart on the Rabbit. On initialization, Rabbit software will find the new drive and add an NVMe namespace for each allocation. If the rebuild commands have been specified, the Rabbit software will run them to add the new NVMe namespace into the RAID device.
35+
36+
## Allocation Status
37+
38+
If the allocation is a `PersistentStorageInstance`, the status of the RAID device is available in the `Status.State` field. If all the RAIDs in the persistent storage are healthy, `Status.State=Active`. If any of the RAIDs are degraded, `Status.State=Degraded`.

docs/guides/storage-profiles/readme.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,78 @@ The `count` field may be useful when creating a persistent file system since the
286286

287287
In general, `scale` gives a simple way for users to get a filesystem that has performance consistent with their job size. `count` is useful for times when a user wants full control of the file system layout.
288288

289+
### RAID Configurations
290+
291+
Allocations can be set up to use a RAID device to provide redundancy in the event of a drive failure. Optionally, commands can be specified to rebuild the RAID device after a replacement drive has been added. The storage profile parameters differ depending on whether the allocation is using LVM or zpool.
292+
293+
#### Zpool
294+
295+
To create a Lustre confiuration with a redundant zpool, the `raidz` option should be added to the `zpoolCreate` command. To allow the zpool to be rebuilt with a new drive, the `zpoolReplace` command should be included.
296+
297+
The example below shows a RAID configuration for the OST, however, the same options can be specified for any of the Lustre targets.
298+
299+
```yaml
300+
apiVersion: nnf.cray.hpe.com/v1alpha8
301+
kind: NnfStorageProfile
302+
metadata:
303+
name: lustre-raid-example
304+
namespace: nnf-system
305+
data:
306+
[...]
307+
lustreStorage:
308+
[...]
309+
ostCommandlines:
310+
mkfs: --ost --backfstype=$BACKFS --fsname=$FS_NAME --mgsnode=$MGS_NID --index=$INDEX
311+
--mkfsoptions="nnf:jobid=$JOBID" $ZVOL_NAME
312+
mountTarget: $ZVOL_NAME $MOUNT_PATH
313+
postActivate:
314+
- mountpoint $MOUNT_PATH
315+
zpoolCreate: -O canmount=off -o cachefile=none $POOL_NAME raidz $DEVICE_LIST
316+
zpoolReplace: $POOL_NAME $OLD_DEVICE $NEW_DEVICE
317+
```
318+
319+
#### LVM
320+
321+
A RAID logical volume can be used with XFS and Raw allocations. gfs2 allocations can not use RAID logical volumes because the LV is shared.
322+
323+
To create a redundant LV, `--type raid[x]` and `--nosync` should be specified in the `lvcreate` command. Also, the `--stripes` parameter should be adjusted accordingly to specify the number of data stripes. For `raid5`, `$DEVICE_NUM-1` is used.
324+
325+
To allow the LV to be rebuilt after a replacement drive is added, `vgExtend`, `lvRepair`, and `vgReduce` should be specified in the `lvmRebuild` section.
326+
327+
```yaml
328+
apiVersion: nnf.cray.hpe.com/v1alpha8
329+
kind: NnfStorageProfile
330+
metadata:
331+
name: xfs-raid-example
332+
namespace: nnf-system
333+
data:
334+
[...]
335+
xfsStorage:
336+
commandlines:
337+
lvChange:
338+
activate: --activate y $VG_NAME/$LV_NAME
339+
deactivate: --activate n $VG_NAME/$LV_NAME
340+
lvmRebuild:
341+
vgExtend: $VG_NAME $DEVICE
342+
vgReduce: --removemissing $VG_NAME
343+
lvRepair: $VG_NAME/$LV_NAME
344+
lvCreate: --activate n --zero n --nosync --type raid5 --extents $PERCENT_VG --stripes $DEVICE_NUM-1
345+
--stripesize=32KiB --name $LV_NAME $VG_NAME
346+
lvRemove: $VG_NAME/$LV_NAME
347+
mkfs: $DEVICE
348+
mountCompute: $DEVICE $MOUNT_PATH
349+
mountRabbit: $DEVICE $MOUNT_PATH
350+
postMount:
351+
- chown $USERID:$GROUPID $MOUNT_PATH
352+
pvCreate: $DEVICE
353+
pvRemove: $DEVICE
354+
sharedVg: true
355+
vgChange:
356+
lockStart: --lock-start $VG_NAME
357+
lockStop: --lock-stop $VG_NAME
358+
vgCreate: --shared --addtag $JOBID $VG_NAME $DEVICE_LIST
359+
vgRemove: $VG_NAME
360+
289361
## Command Line Variables
290362
291363
### global

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ nav:
2828
- 'Switch a Node From Worker to Master': 'guides/node-management/worker-to-master.md'
2929
- 'Directive Breakdown': 'guides/directive-breakdown/readme.md'
3030
- 'System Storage': 'guides/system-storage/readme.md'
31+
- 'Redundant Allocations': 'guides/redundant-allocations/readme.md'
3132
- 'Repo Guides':
3233
- 'Releasing NNF Software': 'repo-guides/release-nnf-sw/release-all.md'
3334
- 'CRD Version Bumper': 'repo-guides/crd-bumper/readme.md'

0 commit comments

Comments
 (0)