MAAS API endpoint for raid, formatting partitions parameter

Hello,

I’m using MAAS 3.5.3, and I struggle to make a software raid-1 with partitions.
The doc says to use :

POST /MAAS/api/2.0/nodes/{system_id}/raids/

with:

partitions (string): Optional. Partitions to add to the RAID.

Although it says it’s optionnal, it is not for me because if I don’t specify use partitions, I need to use block_devices instead.
If I use none of those two, I get:

At least one block device or partition must be added to the array.

If I try to pass "part1_id, part2_id", I get:

Select a valid choice. “part1_id, part2_id” is not one of the available choices.

If I try to pass "part1_id part2_id", I get:

Select a valid choice. “part1_id part2_id” is not one of the available choices.

But if I try "part1_id", I get:

RAID level 1 must have at least 2 raid devices and any number of spares.

So I guess it is indeed recognized as a partition, and the one thing I miss is the right formatting to pass two partitions.

My body is always:

{
    "level": "raid-1",
    "partitions": "<tbd>"
}

Does someone have a hint?

Thanks!

Hi @setenforce1

I am able to create a partition with the MAAS CLI on MAAS 3.5.3 with the following command:

maas $profile raids create $machine_system_id partitions=sda-part1 partitions=sda-part2 level=raid-1 name=my-raid

The key thing here is to repeat the partitions parameter.

1 Like

Thanks a lot,

Unfortunately if I try:

{
    "level": "raid-1",
    "partitions": "<partname_1>"
    "partitions": "<partname_2>"
}

It tells me to provide a list of value.
So I tried:

{
    "level": "raid-1",
    "partitions": [ "<partname_1>", "<partname_2>" ]
}

And it works!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.