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

storage: also allow raid devices to match install-media: true #2142

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Jan 20, 2025

If the installation media is a RAID (this is a mostly a OEM use-case), using {"install-media": true} as a disk matcher fails to find the expected RAID device.

This is because in the previous implementation, only Disk objects could have _has_in_use_partitions=True.

We now also set _has_in_use_partitions=True on involved Raid objects.

In theory, this means that for a given RAID, the matcher can return one Raid object + N * Disk objects.

In practice though, we only use disk matchers on "potential boot disks". This should exclude from the equation Disk objects that are part of a Raid. So we can reliably expect a single match.

LP:#2094966

If the installation media is a RAID (this is a mostly a OEM use-case),
using {"install-media": true} as a disk matcher fails to find the
expected RAID device.

This is because in the previous implementation, only Disk() objects could
have _has_in_use_partitions=True.

We now also set _has_in_use_partitions=True on involved Raid() objects.

In theory, this means that for a given RAID, the matcher can return
one Raid() object + N * Disk() objects.

In practice though, we only use disk matchers on "potential boot disks".
This should exclude from the equation Disk() objects that are part of a
Raid(). So we can reliably expect a single match.

LP: #2094966

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
@ogayot ogayot marked this pull request as draft January 20, 2025 18:04
@ogayot
Copy link
Member Author

ogayot commented Jan 20, 2025

cc @medicalwei

@ogayot ogayot marked this pull request as ready for review January 21, 2025 11:30
@ogayot ogayot merged commit b0b09f6 into canonical:main Jan 23, 2025
10 checks passed
@ogayot ogayot deleted the has-in-use-partitions-raid branch January 23, 2025 08:57
@ogayot ogayot mentioned this pull request Jan 27, 2025
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.

4 participants