In-memory Drives (if you need a sandbox)

The product allows you to create in-memory drives that can be used to set up a RAID. However these drives has the following limitations:

  1. The drives are not persisted across the xiRAID engine restart or server reboot. If a RAID is based on memory drives on restart the RAID restore will fail. To recover the situation you have to destroy such RAID manually using “raid destroy” command, otherwise phantom RAID is kept persisted in the configuration.
  2. The drives are allocated in the hugemem area, which decreases the memory available for the xiRAID engine.
  3. Once created, in-memory drive can’t be destroyed until the engine restart. The feature to destroy in-memory drives will be available in one of the upcoming releases.

To create an in-memory drive, use the command:

xnr_cli bdev malloc create -n <name> --block-size <block_size> --num-blocks <number_of_blocks>

On success the new drive will be available in the system. Its size in bytes is equal to the provided block_size multiplied to the number_of_blocks.

In-memory drives are not reported by Device Manager because they are not associated to any physical device. The in-memory drives can be listed by xnr_cli bdev show orxnr_cli bdev show -n <name> command as shown below. In-mamory drive BDEVs can be filtered by the product name equal to “Malloc disk” in the list.

Example:
$ xnr_cli bdev show --name memDrv0
[
{
        "assigned_rate_limits": {
               "r_mbytes_per_sec": 0,
               "rw_ios_per_sec": 0,
               "rw_mbytes_per_sec": 0,
               "w_mbytes_per_sec": 0,
        },
        "block_size": 4096,
        "claimed": false,
        "name": "memDrv0",
        "num_blocks": 65536,
        "product_name": "Malloc disk",
        "supported_io_types": {
                "abort": true,
                "compare": false,
                "compare_and_write": false,
                "flush": true,
                "nvme_admin": false,
                "nvme_io": false,
                "read": true,
                "reset": true,
                "unmap": true,
                "write": true,
                "write_zeroes": true
        },
        "uuid": "9d2eaafa-6909-4688-910e-0d13fd057a2d",
        "zoned": false
}
]

If there is no enough memory to create in-memory drive the error is returned:

$ xnr_cli bdev malloc create --block-size 4096 --num-blocks 655360 
  2024-00-00T00:00:00.681Z        ERROR   Fail to call remote malloc create: Fail to create malloc disk, Internal error -12