Skip to content

Improve default workshop configuration - #1111

Open
jonathan-conder wants to merge 10 commits into
mainfrom
chore/vm-defaults
Open

jonathan-conder wants to merge 10 commits into
mainfrom
chore/vm-defaults

Conversation

@jonathan-conder

@jonathan-conder jonathan-conder commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes

  • Masks some unwanted services that do automatic updates. We have workshop refresh for that, and these services can interfere with other things. Fixes Should suppress or wait for unattended-upgrades #1027.
  • Masks getty so that systemd starts properly (not degraded) in 26.04 workshops.

Optimisations

Resources

  • Sets root disk size for VMs to 10GB. Since most data is stored in SDK volumes and other mounts, this should be enough for most use cases. It matches the LXD default, but previously users could override it with profiles. Now VM block devices will be consistent among snapshots, but users are free to expand the disk post-launch if they want to.
  • Increases the maximum RAM for VMs to 4GiB. Among other things this should be enough to run nested VMs.
  • Relaxes the storage pool system check in favour of stricter checks that only run on launch and refresh.
  • Adds a check to prevent launching a workshop when the host is low on RAM.

Self-review quick check

  • Make decisions that cost a lot to reverse explicit in the PR description.
  • Avoid nested conditions.
  • Delete dead code and redundant comments.
  • Normalise symmetries by sticking to doing identical things identically.
// one way to handle errors
if err := f(); err != nil {
   ...
}

// one way to handle multiple returns
val, err := f()
if err != nil {
   ...
}
...
  • Check that coupled code elements, files, and directories are adjacent. For example, test data is stored as close as possible to a test.
  • Put variable declaration and initialisation together.
  • Divide large expressions into digestable and self-explanatory ones. Use multiple variables if required.
  • Put a blank line between two logically different chunks of code.
  • Follow the style guide for new error messages.

Docs

Procedure:

  • I have checked and added or updated relevant documentation.
  • I have checked and added or updated relevant release notes.
  • I have included the technical author in the review.

Content:

  • Headings and titles accurately describe the content.
  • New and updated pages include correct metadata.
  • Documentation tests are added or updated where applicable (for tutorial/ and how-to/ sections).
  • Documentation follows the style guide.
  • If needed, docs/.coverage.yaml updated, coverage tags added (.. artefact).

Or:

  • I confirm the PR has no implications for documentation.

Copilot AI 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.

🟡 Changes recommended

Refreshing expanded VM disks requests an unsupported shrink, and VM snapshot expectations omit the new resource defaults.

2 open issues
What changed in this PR

Improves Workshop’s LXD defaults and resource checks, including suppressing automatic updates that can interfere with SDK setup.

Changes:

  • Masks unwanted services and enables host image reuse.
  • Sets VM resource defaults and adds memory and storage checks.
  • Optimizes SDK metadata extraction and updates tests.
File Description
internal/​workshop/​lxd/​tests/​integration/​snapshot-format-vm.yaml Records VM image-access configuration.
internal/​workshop/​lxd/​tests/​integration/​snapshot-format-container.yaml Records container image-access configuration.
internal/​workshop/​lxd/​tests/​integration/​snapshot_test.go Excludes variable logrotate state.
internal/​workshop/​lxd/​lxd_backend.go Updates resource defaults and capacity checks.
internal/​workshop/​lxd/​lxd_backend_test.go Tests defaults and resource thresholds.
internal/​workshop/​lxd/​lxd_backend_snapshots.go Bumps snapshot format revision.
internal/​workshop/​lxd/​lxd_backend_sdk.go Checks storage before SDK imports.
internal/​workshop/​lxd/​export_test.go Exposes helpers for testing.
internal/​workshop/​lxd/​cloudconfig.go Masks update services and console getty.
internal/​overlord/​sdkstate/​handlers.go Stops extraction after finding SDK metadata.
internal/​osutil/​meminfo.go Reads host memory availability.
internal/​osutil/​meminfo_test.go Tests memory information parsing.
.github/​workflows/​spread.yaml Enables image reuse for Spread VMs.

Review effort: Balanced

Comment thread internal/workshop/lxd/lxd_backend.go Resolved

Copilot AI 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.

🔵 Needs a closer look

VM rebuild and resource-admission changes need live LXD validation, and the automatic-update race remains unresolved.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread internal/workshop/lxd/cloudconfig.go Resolved
@jonathan-conder
jonathan-conder marked this pull request as ready for review October 21, 2026 04:03
Copilot AI balanced review requested due to automatic review settings October 21, 2026 04:03

Copilot AI 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.

🟡 Changes recommended

VM refreshes can still fail when disks are expanded or storage pools use non-default volume sizes.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread internal/workshop/lxd/lxd_backend.go Resolved
Comment thread internal/workshop/lxd/lxd_backend.go Resolved
Base automatically changed from fix/vm-pci-port-limit to main October 21, 2026 08:41
Copilot AI balanced review requested due to automatic review settings October 21, 2026 10:16

Copilot AI 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.

🔵 Needs a closer look

The VM snapshot disk-resizing sequence needs targeted live LXD regression coverage and human validation.

3 open issues
1 resolved since last review

Review effort: Balanced

}

if res.Space.Total == 0 {
return checkPoolSpace(res.Space.Total, res.Space.Used, 0)

@nicolasbock-canonical nicolasbock-canonical 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.

LGTM

Copilot AI balanced review requested due to automatic review settings November 5, 2026 06:01
@jonathan-conder
jonathan-conder removed this pull request from stack #1107 November 5, 2026 06:02

Copilot AI 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.

🟡 Changes recommended

Host-image reuse remains disabled because the shared workshop configuration omits security.devlxd.images, and the storage documentation still describes the obsolete 90%-full degraded-mode threshold.

4 open issues

Review effort: Balanced

Comment thread internal/workshop/lxd/lxd_backend.go Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 06:08

Copilot AI 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.

🔵 Needs a closer look

The configuration omits security.devlxd.images, leaving nested LXD image reuse disabled, and the storage documentation still describes the obsolete 90% threshold instead of the new reserve and operation-specific checks.

2 open issues
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 5, 2026 07:33

Copilot AI 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.

🟡 Changes recommended

The Spread cache key can reuse an unpatched binary with the old 8GB limit, and the linked storage documentation still describes the obsolete 90% degraded-mode threshold.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread .github/workflows/build-deps.yaml Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 08:03

Copilot AI 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.

🔵 Needs a closer look

The storage reference still documents a 90% degraded-mode threshold instead of the new 256 MiB reserve and separate operation-specific space checks, leaving recovery guidance outdated.

1 open issue
1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
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.

Should suppress or wait for unattended-upgrades

3 participants