yast / yast-storage-ng

Rewrite of https://github.com/yast/yast-storage
http://yast.github.io/
GNU General Public License v2.0
13 stars 19 forks source link

[GuidedProposal] Support for more Agama-based scenarios #1372

Closed ancorgs closed 4 months ago

ancorgs commented 5 months ago

Problem

At #1335, we introduced changes to make it possible to force the location of certain volumes, even when the allocate_volume_mode was set to auto.

But there was still one combination that didn't work. When LVM was used to group the system volumes it was not possible to allocate one of the volumes in a separate partition without creating a dedicated volume group for it.

On the other hand, on recent tests we found mandatory actions to make space were not being properly executed in all cases. Mandatory actions were only applied to the disks listed at candidate_devices, but that was not enough after the changes introduced in the mentioned pull request #1335.

Last but not least, we wanted to make it possible for Agama to specify that a given volume should reuse an existing block device instead of creating a new partition and/or logical volume, similar to what the AutoYaST profile can do.

Solution

The GuidedProposal algorithm is modified to pre-calculate an initial list of planned devices before executing the mandatory space-making actions. Thus, additional disks are not longer overlooked.

That change is performed as several steps in separate commits for easier review.

Additionally, this pull request introduces new fields reuse_name and reformat for the volumes, making it possible to reuse existing block devices or even file-systems. That depends on the previous changes in the algorithm already mentioned.

Testing

Added new unit tests for all the Agama combinations and adapted existing ones.

To be done

The behavior about what to keep / delete while making space is a bit surprising in some scenarios. That's not a consequence of the changes introduced in this pull request but on how the :bigger_resize strategy of the SpaceMaker is defined.

We need to reconsider those cases and decide how do we want SpaceMaker to act. On the bright side, now we have many test cases marked with FIXME and pointing to a Trello card that will be soon handled by the YaST Team.

coveralls commented 5 months ago

Coverage Status

coverage: 97.81% (+0.01%) from 97.798% when pulling f9b70dfe0c71a2bdce2d5aacaf8f73a544954b8b on ancorgs:agama_fix_combinations into 7157f8f78921ca688a41618f362ea2e04a0d4423 on yast:master.

yast-bot commented 4 months ago

:heavy_check_mark: Internal Jenkins job #1147 successfully finished :heavy_check_mark: Created OBS submit request #1154849