@bedfordc thank you for sharing your script, it showed/indicated what effort it possibly would become. In my use case, the need to label the drives comes in the next step. Using juju to deploy the same charm on heterogeneous platforms. In those cases, it makes a huge difference if the cache storage is placed on the NVME/SSD or on the spinning rust. ATM, it seems that the NVME/SSDs end up at the end, but then where is that? Given that the number of spinning drives are varying.
I guess will end up as a feature request.
- Let MAAS do its commissioning.
- If the user wants to name the devices differently, let them do that via the UI.
- When the device is commissioned again or deployed.
- If the device has been modified in the UI.
- MAAS dynamically creates and appends a custom script, that creates the appropriated udev aliases (basically creates /etc/udev/rules.d/local_disknames).
- Otherwise, process the device as normal (no script injection).
But, that would require MAAS to 1) enable users to fiddle in the UI, but probably quite similar to the NIC edit feature. 2) check if custom names are present, 3) create a script and inject dynamically, during the commissioning/deployment phase.
A benefit of this approach, cf. manually adding a script that has to fit all nodes, the initial ideal by @alexsander-souza, would be that this script has access to detailed attributes, thus removing (or at least lowering) any randomness that might occur.
Sounds reasonable, or am I missing some fundamental aspect?