Skip to content

Service: Allow distributed storage config without adding new disks - #859

Merged
roosterfish merged 9 commits into
canonical:mainfrom
roosterfish:reuse_ceph_fix
Jul 22, 2025
Merged

Service: Allow distributed storage config without adding new disks#859
roosterfish merged 9 commits into
canonical:mainfrom
roosterfish:reuse_ceph_fix

Conversation

@roosterfish

@roosterfish roosterfish commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

Preceded by:

Fixes #812.

The PR ensures that an existing (configured) MicroCeph cluster can be reused by MicroCloud without the need of having to add additional disks during the process.

In a scenario with multiple nodes running MicroCeph, a user might decide to leverage the MicroCeph cluster which is already configured with OSDs for MicroCloud. MicroCloud allows this re-use and asks during the interactive questionnaire if the user wants to reuse this existing cluster.
However until now MicroCloud required to add additional disks (OSDs) to be able to include this existing cluster.
This limitation is now removed and the re-use of disks is made more transparent to the user by printing the already configured disks if the user decides to re-use the existing MicroCeph cluster.

@roosterfish
roosterfish force-pushed the reuse_ceph_fix branch 3 times, most recently from d2c0fe2 to bea2dad Compare July 9, 2025 09:15
@github-actions github-actions Bot added the Documentation Documentation needs updating label Jul 9, 2025
@github-actions github-actions Bot removed the Documentation Documentation needs updating label Jul 10, 2025
@roosterfish
roosterfish force-pushed the reuse_ceph_fix branch 8 times, most recently from 39c3cea to fefbd15 Compare July 14, 2025 12:59
@roosterfish
roosterfish marked this pull request as ready for review July 14, 2025 14:14
@roosterfish
roosterfish requested a review from markylaing July 14, 2025 14:57
We don't anymore print newlines in the terminal as this collides with different terminal windows sizes
as we cannot simply determine the best place for the newline.

Instead the text breaks naturally in case of smaller window sizes.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
…skipped

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>

@markylaing markylaing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few nitpicks about variable names and comments but the main thing is the loop over each member to collect the configured ceph disks. It seems odd to be looping over each member when there is a comment stating that we only need to get the disks once.

Comment thread cmd/microcloud/ask.go Outdated
Comment thread cmd/microcloud/ask.go
Comment thread cmd/microcloud/ask.go Outdated
Comment thread cmd/microcloud/ask.go Outdated
Comment thread cmd/microcloud/ask.go Outdated
@roosterfish
roosterfish force-pushed the reuse_ceph_fix branch 2 times, most recently from f6fc16d to c5575c3 Compare July 22, 2025 10:14
Comment thread cmd/microcloud/ask.go
…isks

This allows understanding which disks on which cluster members are already configured for remote storage.
The information can then be yielded to the user and allows skipping the selection of additional disks
in case the user only wants to configure distributed storage without adding additional disks to MicroCeph.

That scenario is important when adding an existing MicroCeph cluster to MicroCloud.

Also move the availableDiskCount to narrow its scope to where it is actually used.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
When adding an already existing MicroCeph cluster, a user doesn't have to add additional disks and can
solely reuse the disks already configured in the cluster.
In case neither the existing cluster nor the systems have any available disks, skip distributed storage.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
…here is at least one disk

In case only the existing MicroCeph cluster is providing disks, don't ask to select additional disks if there are none.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
…ommendations warning

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
…rinted

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
This allows to configure distributed Ceph storage but without asking for additional disks (in case there are none).
In this case the existing Ceph cluster including it's already configured disks are used.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
…ng new disks

This tests to configure distributed storage using an existing Ceph cluster without adding additional disks.
That is a valid scenario where Ceph is already fully setup and just needs to be integrated into MicroCloud.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>

@markylaing markylaing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM thanks :)

@markylaing

Copy link
Copy Markdown
Contributor

Looks like there is a failed test though, I'm not sure if that one was already flaky?

@roosterfish

Copy link
Copy Markdown
Contributor Author

Looks like there is a failed test though, I'm not sure if that one was already flaky?

Yeah the e2e is flaky, but after we get canonical/lxd#16071 in we can then finally merge #798 which should resolve the issues we see with this test.

@roosterfish
roosterfish merged commit 473f03f into canonical:main Jul 22, 2025
52 of 54 checks passed
@roosterfish
roosterfish deleted the reuse_ceph_fix branch July 22, 2025 14:33
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.

MicroCloud offers to set up distributed storage after adding existing microceph cluster

2 participants