MaaS CLI partitioning with some UUID is failing => {"uuid": ["Enter a valid value."]}

Hello Everyone,

I hope you’re doing fine !

I have removed some partition on the configuration of a machine using MaaS CLI.
I am now trying to populate, without success, new ones like this :

+ uuidgen -s -N SomeName/1 -n @url
3df7a980-0401-5fb3-b50c-a1b02654ac2a
+ maas region partitions create a4ghwe sda size=17179869184 uuid=3df7a980-0401-5fb3-b50c-a1b02654ac2a
{"uuid": ["Enter a valid value."]}

Using value taken from another, already installed machine, from ls /dev/disk/by-uuid is working.
I tried to search the web but I was not able to find any restriction about UUID usage.

Could someone point me some documentation about the controls done on UUID for MaaS partitioning ?

Thanks in advance,
Have a nice day,
Best Regards,
Mickaël.

Hi @mkl1!

You have to use a UUID4. 3df7a980-0401-5fb3-b50c-a1b02654ac2a is a UUID5!

Hello r00ta,

Thanks for your answer.

Could you point me some documentation about UUID , like how to know UUID version by reading it and why we cannot use any UUID for partitions ?

Thanks in advance,
Have a nice day,
Best Regards,
Mickaël.

UUID4 are in the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx.
ATM MAAS will throw an error if you try to use UUID1 or UUID5 (as you noticed).

You can use uuidgen -r for example and you should be good to go

Thanks for your answer r00ta.

I will manually build some.

Why a limitation on UUID version?
Could you point me some UUID specs about their usage and link with partition UUIDs ?

Thanks,
Regards,
Mickaël.

Sure, here you can see the validation that is performed by MAAS. It’s a regex match on UUID4 format.

By heart if you remove that check and you try to use UUID1 or UUID5 it might work as I’m not aware of any restriction. But UUID4 is the standard for fs uuids.

You can find uuid4 string generators online btw

Are you looking for some MAAS docs about UUIDs?

Understood, thanks.

Not specifically about MaaS, but if you have, I’ll take them.
It is just to understand if there is any restriction, for any reason, to use UUID1,2,3,4,5 for partition UUID, explained somewhere, as I did not have a good understanding about UUIDs.

There are many online, for example this one

1 Like

Thanks for your answer.
I quickly go trough your link and I guess that I did know and understand all that.

The question is more about UUID version X VS UUID version Y and why it is limited in MaaS.
Which may be linked in how they are used by the underlay linux.

Have a nice weekend ; - )