Skip to content

Conversation

@GeraldEV
Copy link
Contributor

Create a SW RAID device using mdadm before installation from specified devices
SW RAID installation only available via answerfile and not included in the answerfile documentation as this feature is not designed for wide support - it was specifically requested by an internal customer

UEFI boot does not understand SW RAID and therefore we need to add an EFI boot entry for each physical disk that makes up the SW RAID device. There is a known bug that the GPT header for the second disk in the SW RAID is not correctly populated and therefore its boot entry is invalid - this will be triaged & addressed in a later PR

GRUB already understands Linux SW RAID devices (via its mdraid1x module) which does not need to be explicitly loaded for GRUB to see the SW RAID device - this was verified via the GRUB command line

udev automatically assembles the SW RAID device when starting

@rosslagerwall
Copy link
Contributor

Will upgrade and restore be handled in a separate PR?

@rosslagerwall
Copy link
Contributor

GRUB already understands Linux SW RAID devices (via its mdraid1x module) which does not need to be explicitly loaded for GRUB to see the SW RAID device - this was verified via the GRUB command line

How did you verify that GRUB was accessing the data via the RAID device rather than just accessing it through one of the RAID members?

@rosslagerwall
Copy link
Contributor

docs/answerfile.txt needs to be updated. Even if this is not documented in XenServer public docs for customers, it should be documented in the code repository.

@GeraldEV
Copy link
Contributor Author

GRUB already understands Linux SW RAID devices (via its mdraid1x module) which does not need to be explicitly loaded for GRUB to see the SW RAID device - this was verified via the GRUB command line

How did you verify that GRUB was accessing the data via the RAID device rather than just accessing it through one of the RAID members?

I entered the grub command line and checked the output of ls which showed md entries pointing to the partition(s) we expected

@ydirson
Copy link
Contributor

ydirson commented May 13, 2025

Nice to see that XenServer is finally interested in this feature - we have an implementation that has been used by XCP-ng users for several years, so maybe we could synchronize? We never opened a PR because XS was not interested at the time, but now it looks like the time can be right.

You may also be interested in #38 as a useful complement.

@MarkSymsCtx
Copy link
Contributor

Nice to see that XenServer is finally interested in this feature - we have an implementation that has been used by XCP-ng users for several years, so maybe we could synchronize? We never opened a PR because XS was not interested at the time, but now it looks like the time can be right.

You may also be interested in #38 as a useful complement.

We're not going to support this, aside from for one specific internal customer, it will not be available to the general user population.

@ydirson
Copy link
Contributor

ydirson commented May 13, 2025

We're not going to support this, aside from for one specific internal customer, it will not be available to the general user population.

But then, especially if that's clearly not something on your roadmap, why spend time reimplementing something that's been in production on our side for more than 6 years? We'd be perfectly OK to, for example, get the non-interactive part in shape to be shared, and get the UI part behind a feature flag.

@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from 0d418d9 to fac602f Compare May 14, 2025 14:06
backend.py Outdated
seq.append(Task(removeBlockingVGs, As(ans, 'guest-disks'), []))

if ans['swraid']:
seq.append(Task(setupSWRAIDDevice, A(ans, 'disk-label-suffix', 'physical-disks'), ['primary-disk']))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This moved block was so that setupSWRAIDDevice could occur before partitionTargetDisk (which would otherwise be unhappy with a missing target device) and after removeBlockingVGs

@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from fac602f to 7fdb932 Compare May 16, 2025 13:15
@GeraldEV
Copy link
Contributor Author

I've pushed two new changes to complete the behaviour and address an issue:

  1. Allow SWRAID to sync before completing the installation (ensuring EFI entries are correct)
  2. Add the second device before completing the installation to ensure writes are not lost due to the disk being busy

@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from 7fdb932 to 3131143 Compare May 23, 2025 09:47
@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from 3131143 to 983a1e3 Compare June 9, 2025 14:08
@GeraldEV
Copy link
Contributor Author

GeraldEV commented Jun 9, 2025

Latest commits address outstanding comments and rebase onto PR #258 - which is a backport of the aforementioned fix: #255

GeraldEV added 3 commits June 12, 2025 10:10
Previously the filterCleanup was only ever called by filter with an
empty list, but due to SWRAID changes; there's scope for it to be called
'properly' with cleanup operations.
This revealed that the filterCleanup incorrectly assumed the arguments
would be automatically unpacked from the tuples.

Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from 983a1e3 to d2b7da1 Compare June 12, 2025 10:11
@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from d2b7da1 to 0297ad2 Compare June 19, 2025 09:10
Copy link
Contributor

@rosslagerwall rosslagerwall left a comment

Choose a reason for hiding this comment

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

This basically looks fine to me. A few minor comments.

GeraldEV added 4 commits June 20, 2025 08:45
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
@GeraldEV GeraldEV force-pushed the private/geralde/CP-54459 branch from 0297ad2 to 399aa34 Compare June 20, 2025 08:46
@GeraldEV GeraldEV requested a review from rosslagerwall June 20, 2025 08:47
@GeraldEV GeraldEV merged commit 3c563c6 into release/xs8 Jun 23, 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.

5 participants