Skip to content

feat(containers): mount shared read-only volume into created containers#422

Open
runleveldev wants to merge 1 commit into
mieweb:mainfrom
runleveldev:shared-mountpoint
Open

feat(containers): mount shared read-only volume into created containers#422
runleveldev wants to merge 1 commit into
mieweb:mainfrom
runleveldev:shared-mountpoint

Conversation

@runleveldev

Copy link
Copy Markdown
Collaborator

Summary

Adds an mp0 mount point to every created container: /mnt/pve/<templateStorage>/volumes/quick_and_dirty is bind-mounted read-only at /mnt/quick_and_dirty.

The host path is derived from the node's resolved template storage, assuming the storage is mounted at /mnt/pve/<storage> (i.e. container templates are downloaded to /mnt/pve/<storage>/template/cache), so shared volumes live at /mnt/pve/<storage>/volumes/<name>.

This is an intentional stopgap: the volume name is hardcoded to quick_and_dirty. #421 tracks turning this into a proper feature where users can define their own volumes with per-volume permissions; a TODO(#421) is left on the new buildSharedVolumeMp0() helper.

Changes

  • New buildSharedVolumeMp0(templateStorage) helper in create-a-container/bin/create-container.js building the mp0 value (/mnt/pve/<storage>/volumes/quick_and_dirty,mp=/mnt/quick_and_dirty,ro=1)
  • OCI image path: mp0 added to the createLxc options, reusing the already-resolved template storage
  • Template clone path: template storage is now resolved in this branch too (non-fatal — if no vztmpl-capable storage exists, the mount is skipped with a warning instead of failing creation, since cloning doesn't otherwise need one) and mp0 is applied via the post-clone updateLxcConfig call

Notes

Testing

  • node --check create-a-container/bin/create-container.js passes (no backend test suite exists for these job scripts)

Refs #421

Bind-mount /mnt/pve/<templateStorage>/volumes/quick_and_dirty into every
created container at /mnt/quick_and_dirty (read-only) via mp0, based on
the node's resolved template storage.

Stopgap: volume name is hardcoded; see TODO(mieweb#421) for the proper
user-defined volumes feature.
Copilot AI review requested due to automatic review settings July 22, 2026 17:22

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.

Copilot wasn't able to review any files in this pull request.

@cmyers-mieweb cmyers-mieweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved, we will need to loop back on this in the future and make an issue to make it an optional feature if the hardware is not under a ceph infrastructure.

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.

3 participants