We are re-using the YaST GuidedProposal at Agama (to be precise, we use MinGuidedProposal which is identical but ignores desired_size and performs only one attempt with the minimum).
The GuidedProposal can find the best location for every requested volumes within a set of candidate devices. It also allows to specify that a given volume must be placed in a specific disk. But turns out it was not able to do both things at the same time!
If a setting called allocate_volume_mode was set to auto (which is the default), assignations of volume to specific disks were ignored and the proposal freely allocated all the volumes within the designated candidate devices. If allocate_volume_mode was set to device then the proposal calculated the candidate devices as the sum of all devices already assigned to a particular volume.
In other words, the proposal was not able to handle requirements like "allocate all volumes at sda except for volume /home that should go alone to sdb".
Solution
Now when the allocate mode is auto, the proposal still honors when a volume is assigned to a specific device, no matter if that device is part of candidate_devices or not.
That allows us to offer the following options at Agama proposal configuration.
Agama's partition-based proposal
All partitions are created in the boot disk by default.
It's possible to override that for a particular volume and specify a target disk for it
That can be achieved by setting the following Y2Storage::Settings
root_device -> boot disk
candidate_devices -> [boot_disk]
Assign device to volumes that don't go to the boot disk
Agama's LVM-based proposal
The system VG is created by default in the boot disk
It's possible to specify a set of several disks if we want the system VG to (potentially) extend over them (will do it only if necessary). It's even possible to select a disk or set of disks that do not include the boot disk.
All LVs are created by default in the system VG
It's possible to override that for a particular volume and specify an alternative VG name and a target disk (only one) for it
That can be achieved by setting the following Y2Storage::Settings
root_device -> boot disk
candidate_devices -> disks to be used to allocate the system VG
separate_vgs -> true
Assign separate_vg_name and device to volumes that don't go to the system VG
Testing
Added unit tests to demonstrate all that is possible now
Review
Better review commit by commit. This also includes a couple of clean-up commits.
Coverage: 97.75% (+0.001%) from 97.749% when pulling f22e5078141b9d57ae9b190f4c791470f67141d9 on ancorgs:agama_adaptations into 7bd8abc5600cfa2fdcec056e34de98eb37b30406 on yast:master.
Problem
We are re-using the YaST
GuidedProposal
at Agama (to be precise, we useMinGuidedProposal
which is identical but ignoresdesired_size
and performs only one attempt with the minimum).The
GuidedProposal
can find the best location for every requested volumes within a set of candidate devices. It also allows to specify that a given volume must be placed in a specific disk. But turns out it was not able to do both things at the same time!If a setting called
allocate_volume_mode
was set toauto
(which is the default), assignations of volume to specific disks were ignored and the proposal freely allocated all the volumes within the designated candidate devices. Ifallocate_volume_mode
was set todevice
then the proposal calculated the candidate devices as the sum of all devices already assigned to a particular volume.In other words, the proposal was not able to handle requirements like "allocate all volumes at sda except for volume
/home
that should go alone to sdb".Solution
Now when the allocate mode is
auto
, the proposal still honors when a volume is assigned to a specific device, no matter if that device is part ofcandidate_devices
or not.That allows us to offer the following options at Agama proposal configuration.
Agama's partition-based proposal
That can be achieved by setting the following
Y2Storage::Settings
device
to volumes that don't go to the boot diskAgama's LVM-based proposal
That can be achieved by setting the following
Y2Storage::Settings
separate_vg_name
anddevice
to volumes that don't go to the system VGTesting
Added unit tests to demonstrate all that is possible now
Review
Better review commit by commit. This also includes a couple of clean-up commits.