feat(containers): mount shared read-only volume into created containers#422
Open
runleveldev wants to merge 1 commit into
Open
feat(containers): mount shared read-only volume into created containers#422runleveldev wants to merge 1 commit into
runleveldev wants to merge 1 commit into
Conversation
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.
cmyers-mieweb
approved these changes
Jul 22, 2026
cmyers-mieweb
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
mp0mount point to every created container:/mnt/pve/<templateStorage>/volumes/quick_and_dirtyis 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; aTODO(#421)is left on the newbuildSharedVolumeMp0()helper.Changes
buildSharedVolumeMp0(templateStorage)helper increate-a-container/bin/create-container.jsbuilding the mp0 value (/mnt/pve/<storage>/volumes/quick_and_dirty,mp=/mnt/quick_and_dirty,ro=1)mp0added to thecreateLxcoptions, reusing the already-resolved template storagevztmpl-capable storage exists, the mount is skipped with a warning instead of failing creation, since cloning doesn't otherwise need one) andmp0is applied via the post-cloneupdateLxcConfigcallNotes
mp0with a host path) toroot@pam, so the manager's API credentials must allow thiscreateLxconly maps known fields), so Docker containers won't get the mount — noted in Support user-defined shared volumes for containers (replace hardcoded quick_and_dirty mp0) #421Testing
node --check create-a-container/bin/create-container.jspasses (no backend test suite exists for these job scripts)Refs #421