Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the :bigger_resize SpaceMaker strategy #1382

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

ancorgs
Copy link
Contributor

@ancorgs ancorgs commented Apr 24, 2024

IMPORTANT: This should be merged in sync with openSUSE/agama#1164, which includes the needed adaptations in the Agama side to keep everything consistent.

Problem

The :bigger_resize strategy was added to give Agama a more fine-grained control of the actions to be performed by the SpaceMaker.

But we found several inconsistencies in the way we originally defined :bigger_resize.

Before this change, the SpaceMaker strategy expected a list like this.

  • For non-partitioned disks (for example, disks directly formatted or acting as LVM PV) it expected one of the following actions:
    • none (ie. keep the content)
    • :delete or :force_delete (ie. wipe the content).
  • For partitions it expected one of the following:
    • none (ie. keep the partition as-is),
    • :delete or :force_delete` (ie. remove the partition)
    • :resize (ie. shrinking the partition)

First problem

The behavior described above turned out to be quite confusing since actions on non-partitioned disks are about the content (filesystems, PVs, etc.) and actions on partitions are about the devices themselves, offering no option for things like keeping the device but allowing to destroy the content.

Second problem

The first problem refers to disks that are part of the candidate devices or are selected as root disk. But the situation of disks or RAIDs that were chosen to be formatted (ie. reused by a volume) also needed clarification.

Additional unrelated problem

While testing this I found that installing on a disk that previously contained a RAID could result in a proposal that didn't include the partitions needed for booting. After some debugging, turns out the culprit was some code introduced many years ago in order to support non-standard RAID1 setups (#788).

Solution

Solution to the first problem

We agreed that having explicit actions for non-partitioned disks has very little value. If a non-partitioned device is selected to be formatted or to be a candidate disk or root disk, it’s content will be deleted if needed no matter whether there is such action. In other words, actions refer to the devices themselves, not to their content. As such, actions only make sense for partitions and maybe for other devices that can be destroyed (like logical volumes if we implement reusing of LVM VGs in the future).

Solution to the second problem

We came to the conclusion that selecting a disk to be directly formatted (or any other partitionable device like a RAID) already implies an statement about deleting all its content (partitions or whatever is there). There is no need to have space actions for those cases (they would be an open door for conflicts). Space actions only make sense for candidate disks and for the root disk. They are not needed for reused devices or its descendants.

Solution to the additional problem

If the root device is explicitly set (something that always happens in the Agama proposals), that value is now honored, ignoring any possible RAID consideration.

Testing

@coveralls
Copy link

coveralls commented Apr 24, 2024

Coverage Status

coverage: 97.802% (+0.001%) from 97.801%
when pulling 88340d6 on ancorgs:better_bigger_resize
into d185af5 on yast:master.

Copy link
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ancorgs ancorgs merged commit 0e39eba into yast:master Apr 25, 2024
7 checks passed
@yast-bot
Copy link

✔️ Internal Jenkins job #1155 successfully finished
✔️ Created OBS submit request #1170162

ancorgs added a commit to openSUSE/agama that referenced this pull request Apr 25, 2024
## Problem

Agama uses the `Y2Storage` strategy to find space called
`:bigger_resize`. That strategy was found to be inconsistent, so it was
slightly modified.

See more details at yast/yast-storage-ng#1382

## Solution

This pull request adapts Agama to the new approach, in which the space
actions are only expected for partitions (and maybe in the future for
logical volumes), but not for whole disks.

1) The actions generated for the pre-defined policies do not longer
include the disks, only partitions.

2) The "Find Space" form only offers the action selector for the
partitions. In the case of disks without partitions, some static texts
are added to help the user understand what can happen with the content
of the disk.


![partition_actions](https://github.com/openSUSE/agama/assets/3638289/d1996c0b-a8de-4cea-8a76-14d8b3240199)

Note we plan to rethink the whole interface of "Find Space" in the short
term. This pull request only aims to keep the UI consistent with the new
logic in the proposal, while the bigger changes arrive.

## Testing

- Unit tests adapted.
- Tested manually together with
yast/yast-storage-ng#1382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants