nix-community / disko

Declarative disk partitioning and formatting using nix [maintainers=@Lassulus @Enzime @iFreilicht]
MIT License
1.86k stars 198 forks source link

support typed restriction of lv creation to specific pvs #422

Open sielicki opened 1 year ago

sielicki commented 1 year ago

pvcreate accepts a trailing argument [PhysicalVolumePath[:PE[-PE]]...] which can be used to restrict logical volume creation to specific physical volume(s).

This is the only really sensible way to create tiered storage for eg: cache creation, #421, but it can be useful in other complex scenarios.

Nothing prevents this from being used today via extraArguments, but it would drop types, ie: would rely on just using the same device string in extraArguments to pv creation as one used for the lv.

iFreilicht commented 1 month ago

I don't quite understand what the final API is supposed to look like. Could you show an example of what you would like to add to a configuration?

Also, are you sure this is possible right now? extraArgs does exist on lvm_vg and is passed to lvmcreate, but lvm_pv does not have an option like that. Would adding this already be sufficient?