Problem Description:
I am writing an autoinstall file for provisioning a bare-metal Ubuntu machine. I am having trouble with provisioining the raid-1. The raid-1 is provisioned on the two nvmes with the smallest space. I am trying to find the smallest nvmes in the early-commands section and then use them in the “storage” section in the autonistall file. I am placing the absolute path of these nvmes in an environment variable and trying to use them in the storage section. This is not taking affect and the error shown in the attached picture
I don’t have long or deep hands-on experience with complex autoinstall RAID setups, so please take this as guidance rather than a definitive solution.
From what I understand, curtin does not expand environment variables or follow runtime symlinks created in early-commands when evaluating the storage.match section. The match.path is resolved very early and must refer to something stable that exists at install time (for example /dev/disk/by-id/*), not files or symlinks under /run.
You may want to try one of these approaches instead:
Use match: { size: smallest } or match: { ssd: true } if it fits your use case.
Match disks via /dev/disk/by-id/ or /dev/disk/by-path/ which curtin handles reliably.
Predefine disk selection logic using match rules only, without relying on early-commands variables.
Hopefully someone with deeper curtin/autoinstall experience can confirm the best pattern here, but this limitation is a common gotcha with autoinstall storage matching.
thanks for your response.
I have used these ones too, but does not take affect. any other suggestions on how to dynamically choose the two smallest disks?
for more info, my testbed is two vms (proxmox as the hypervisor)which one is the pxe server with autoinstall on it, and the other one is the candidate client which have three disks; two of them 10 G and one 15 G and when the early commands run; it shows sda and sdc as the two 10 G disks and sdb as the 15 G disk.
Thanks for the extra details. I did a bit more digging into this, and here’s what I found.
This looks like a limitation in curtin’s disk matching, not an issue with your logic. match: { size: smallest } / second-smallest are evaluated globally and are not deterministic, especially once partitioning and RAID start. Curtin also doesn’t reliably expand variables or follow runtime symlinks created in early-commands.
For now, you may want to try one of these as a workaround:
Match disks explicitly using /dev/disk/by-id/ or /dev/disk/by-path/
Further constrain matching (e.g. combine ssd: true with size), though this isn’t guaranteed
Control disk order/sizing at the Proxmox level for predictable results
You can try this approach for now, at least until someone with deeper autoinstall/curtin experience can confirm a better pattern.