Skip to content

Add: Prevent skipping local storage - #1571

Open
wak327 wants to merge 5 commits into
canonical:mainfrom
wak327:add-require-local-storage
Open

wak327 wants to merge 5 commits into
canonical:mainfrom
wak327:add-require-local-storage

Conversation

@wak327

@wak327 wak327 commented Oct 1, 2026

Copy link
Copy Markdown

Fixes #862

#1034 covered the networking half of this issue. This PR covers the storage half, using the same approach.

If the existing cluster already has the local storage pool, the new members must also be set up with a disk for it. Right now microcloud add still asks Would you like to set up local storage?, and answering no causes errors later in the setup. With this change:

  • If the cluster already has the local pool and we are not bootstrapping, the yes/no question is skipped and the disk selection table is shown straight away. The table already requires exactly one disk per new system.
  • If any new system has no available disk, microcloud add now fails right away with Cannot set up the existing local storage pool on all new systems. Some systems do not have an available disk. Before, it printed a warning and skipped the pool.

Nothing changes for microcloud init. Nothing changes for microcloud service add either, since it runs with bootstrap: true. Adding to a cluster that doesn't have the local pool still asks the question as before.

Test suite: following the SETUP_OVN_EXPLICIT/SETUP_OVN_IMPLICIT split from #1034, this adds SETUP_ZFS_IMPLICIT, which skips the yes/no answer but still selects the disks. The add sessions that join a cluster which already has the local pool now use it: two in test/suites/add.sh and two in test/suites/basic.sh. I checked that microcloud_interactive produces the same input as before for SETUP_ZFS=yes, and the same input minus the yes line for SETUP_ZFS_IMPLICIT=yes. I couldn't run the LXD-based system suites locally, so CI will be the first full run.

Checklist

@wak327

wak327 commented Oct 1, 2026

Copy link
Copy Markdown
Author

@roosterfish this follows #1034 for the storage half of #862: when the cluster already has the local pool, add no longer asks whether to set up local storage, and it fails early if a new member has no available disk. The system tests get a matching SETUP_ZFS_IMPLICIT. Could you take a look?

Comment thread test/suites/basic.sh

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Storage setup behavior warrants final human review.

Review effort: Lite
Findings: None

What changed in this PR

Updates microcloud add to require local-storage disks when joining a cluster with an existing local pool.

Changes:

  • Enforces disk availability for all new members.
  • Skips the redundant storage prompt during applicable joins.
  • Updates test helpers and integration scenarios.
File Description
test/​suites/​basic.sh Updates cluster-growth scenarios.
test/​suites/​add.sh Updates add-session coverage.
test/​includes/​microcloud.sh Supports implicit ZFS disk selection.
cmd/​microcloud/​ask.go Enforces mandatory local disk selection for joins.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@roosterfish roosterfish 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.

I was giving it a try and this already looks good. But after removing the question whether or not to configure local storage, it should be clear for the user what the table is about when getting prompted to select a disk:

Gathering system information...
Select exactly one disk from each cluster member:          
 Filter | <type to filter rows>
   ┌──────────┬───────────────┬──────────┬──────┬────────────────────────────────────────────────────┐
   │ LOCATION │     MODEL     │ CAPACITY │ TYPE │                        PATH                        │
   ├──────────┼───────────────┼──────────┼──────┼────────────────────────────────────────────────────┤
 > │ micro02  │ QEMU HARDDISK │ 10.00GiB │ scsi │ /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_disk1 │
   │ micro02  │ QEMU HARDDISK │ 10.00GiB │ scsi │ /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_disk2 │
   └──────────┴───────────────┴──────────┴──────┴────────────────────────────────────────────────────┘
 space to select; enter to confirm
 ↑/↓ to move; → to select all; ← to select none

So what about changing the sentence Select exactly one disk from each cluster member: to Select exactly one disk from each cluster member for local storage:?

@wak327

wak327 commented Oct 7, 2026

Copy link
Copy Markdown
Author

@roosterfish thanks, good point. The prompt now reads Select exactly one disk from each cluster member for local storage: (954fee6), and the multi-member tutorial output is updated to match (c06b1a3). Could you take another look?

@github-actions github-actions Bot added the Documentation Documentation needs updating label Oct 7, 2026
roosterfish
roosterfish previously approved these changes Oct 9, 2026

@roosterfish roosterfish 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.

Thanks, looks good to me. I'll merge once we are done cutting the branch for the upcoming release cycle.

Comment thread cmd/microcloud/ask.go Outdated
@roosterfish

Copy link
Copy Markdown
Contributor

You can rebase with main to unblock the docs test.

@wak327

wak327 commented Oct 10, 2026

Copy link
Copy Markdown
Author

@roosterfish I rebased onto main to unblock the docs check and addressed both inline comments: the error now names the affected system using the MicroOVN wording, and there's a new system test that triggers it. Could you take another look?

Comment thread test/suites/add.sh Fixed
Comment thread test/suites/add.sh Outdated

@roosterfish roosterfish 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.

Please also squash the two new commits with the existing ones that add the new error message/tests so that you don't add and remove changes in the same PR.

In case the existing cluster already has the local storage pool, new members cannot skip the disk selection
as the pool is required on every cluster member.
Fail early if any of the new members does not have an available disk.

Signed-off-by: Waleed Khalid <wak327@gmail.com>
Signed-off-by: Waleed Khalid <wak327@gmail.com>
@wak327
wak327 force-pushed the add-require-local-storage branch from bfabfb8 to c41ae07 Compare October 13, 2026 05:46
@wak327

wak327 commented Oct 13, 2026

Copy link
Copy Markdown
Author

@roosterfish I switched the test to lxc storage volume detach as you suggested and squashed the follow-ups into the original commits: the error message change is now part of 564100e and the new test is part of dc00e49, so nothing gets added and then changed within the PR. Could you take another look?

@roosterfish roosterfish 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.

One more comment after reviewing the added test.

Comment thread test/suites/add.sh Outdated
Signed-off-by: Waleed Khalid <wak327@gmail.com>
Signed-off-by: Waleed Khalid <wak327@gmail.com>
Signed-off-by: Waleed Khalid <wak327@gmail.com>
@wak327
wak327 force-pushed the add-require-local-storage branch from c41ae07 to af11802 Compare October 13, 2026 10:54
@wak327

wak327 commented Oct 13, 2026

Copy link
Copy Markdown
Author

@roosterfish I've removed the unnecessary snap toggling for micro04 in the new test and squashed it into the existing test commit. Could you take another look?

@roosterfish roosterfish 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.

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation needs updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

microcloud add should exit if mandatory selections aren't made

4 participants