Create

The RAID lifecycle begins from the “raid create” command. Before creating the RAID you have to make sure that the corresponded devices are attached or attach them by the Device Manager operation if needed.

The drive shall be clean to be able using them for new RAID. If first 4 Kbytes of a drive are not zero the drive cannot be used by new RAID. This prevents to add a drive with useful data by mistake. For example, a drive participated in another unloaded RAID. If drives are not clean, they can be zeroed by the following command:

xnr_cli bdev zero --bdevs 0000:06:0a.0n1,0000:06:0b.0n1,
0000:06:0c.0n1,0000:06:0d.0n1,0000:06:0e.0n1,0000:06:0f.0n1

To create a RAID use the command:

xnr_cli raid create --name xnraid --uuid 75fdd4fc-d93d-484f-ae3d-cbe3f1e4e541 --level 50 --chunk-size 64 --block-size 512 --group-size 3  --bdevs 0000:06:0a.0n1,0000:06:0b.0n1,0000:06:0c.0n1,
0000:06:0d.0n1,0000:06:0e.0n1,0000:06:0f.0n1

level can be one of 0, 1, 5, 6, 7, 10, 50, 60, 70.

block-size can be 4096 or 512 bytes. It defines the RAID block device minimal IO size. If underlined drives (bdevs) use 4096 block size the RAID block size 512 is not allowed.

chunk-size specifies each drive data chunk size in Kbytes in scope of single RAID stripe. For example, RAID 5 on 8 drives with chunk size 64 has full stripe size equal to 64*7 = 448 Kbytes. Chunk size should be selected based on client IO data pattern and backend device firmware logic to optimize IO performance and latency.

uuid is an optional parameter. It is recommended to provide UUID to identify the RAID in big installations. If UUID is not provided it is autogenerated during RAID create operation and is reported by “raid show” operation. The UUID can be used together or instead of “name” parameter in any RAID related operation to identify the RAID. “name” is useful for manual input while UUID is better for scripting.

The create operation adds the RAID configuration to the persisted database and sets auto-start option to the RAID. The RAID is available for user’s IO as soon as the create operation completes. If the engine is restarted or the node is rebooted the RAID is automatically restored to the operational mode (if required number of RAID’s drives are attached and available). Auto-starting the RAID flow is similar to the RAID restore operation.