Skip to content

volumes: separate shared volume storage from rootfs storage - #491

Open
runleveldev wants to merge 1 commit into
mieweb:mainfrom
runleveldev:feature/shared-volume-storage
Open

runleveldev wants to merge 1 commit into
mieweb:mainfrom
runleveldev:feature/shared-volume-storage

Conversation

@runleveldev

Copy link
Copy Markdown
Collaborator

Problem

Node.volumeStorage was used for both container root filesystems (rootdir) and the persistent volumes root (#421). These need different semantics: rootfs is fine on thin-provisioned block storage (LVM-thin, Ceph RBD, ZFS), but volumes are bind-mount directories and require a path-backed shared filesystem (CephFS/NFS). With the default local-lvm, volume creation fails ("no host path"); switching to CephFS/NFS to make volumes work forces rootfs onto raw images on a shared FS.

Change

  • New nullable Nodes.sharedVolumeStorage column (migration + model).
  • volumesStorageName(node) in utils/volumes.js: sharedVolumeStorage → volumeStorage → imageStorage → 'local'. Used by resolveVolumesRoot and the node-save volumeStorageWarnings.
  • Rootfs provisioning (bin/create-container.js) is unchanged and still uses volumeStorage.
  • API accepts/returns sharedVolumeStorage (blank → null); OpenAPI updated.
  • Node form: "Volume storage" relabeled Root disk storage; new optional Shared volume storage field.
  • Docs updated (nodes, volumes, deploying-agents, database schema).

Backward compatible: existing nodes have sharedVolumeStorage = null and behave exactly as before.

Notes

  • The setting is per node, consistent with the other storage settings. Since there is one agent / volumes root per site, a site-level setting could be a follow-up.
  • DB column volumeStorage keeps its name; only the UI label changed.

Testing

  • npx jest utils/__tests__/volumes.test.js routers/api/v1/__tests__/nodes* — 50 passed (new tests for the fallback chain and for preferring shared storage over block rootfs storage).
  • middlewares/__tests__/mcp-proxy.test.js fails on main as well; unrelated.

Root disks can live on thin-provisioned block storage (lvmthin/rbd/zfs)
while persistent volumes need a path-backed shared filesystem
(cephfs/nfs). Add an optional Node.sharedVolumeStorage used for the
volumes root, falling back to volumeStorage when unset.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:38

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 review overview

🟡 Changes recommended

The single-agent deployment instructions do not support distinct per-node volume roots, and API coverage and localization remain incomplete.

Review effort: Balanced
Findings: 4 Low severity

Open (4)
What changed in this PR

Separates persistent-volume storage from container root-disk storage while preserving backward-compatible fallback behavior.

Changes:

  • Adds sharedVolumeStorage across the database, API, client, and documentation.
  • Routes persistent-volume path resolution and warnings through the new storage preference chain.
  • Adds fallback and shared-storage resolution tests.
File Description
mie-opensource-landing/​docs/​developers/​database-schema.md Documents the new Node field.
mie-opensource-landing/​docs/​admins/​deploying-agents.md Updates agent volume-root setup.
mie-opensource-landing/​docs/​admins/​core-concepts/​volumes.md Explains shared volume storage.
mie-opensource-landing/​docs/​admins/​core-concepts/​nodes.md Documents separate storage settings.
create-a-container/​utils/​volumes.js Implements the storage fallback chain.
create-a-container/​utils/​__tests__/​volumes.test.js Tests storage selection and resolution.
create-a-container/​routers/​api/​v1/​nodes.js Accepts, returns, and validates the setting.
create-a-container/​openapi.v1.yaml Extends Node API schemas.
create-a-container/​models/​node.js Adds the Sequelize model field.
create-a-container/​migrations/​20261002000000-add-node-shared-volume-storage.js Adds the nullable database column.
create-a-container/​client/​src/​pages/​nodes/​NodeFormPage.tsx Adds the shared-storage form input.
create-a-container/​client/​src/​lib/​types.ts Extends the client Node type.

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

Comment on lines +212 to +216
<Input
label="Shared volume storage"
placeholder="Defaults to root disk storage"
helperText="Path-backed shared filesystem (CephFS/NFS) for persistent volumes; volumes live under <path>/volumes"
{...register('sharedVolumeStorage')}
tlsVerify === '' || tlsVerify === null || tlsVerify === undefined ? null : tlsVerify === true || tlsVerify === 'true',
imageStorage: imageStorage || 'local',
volumeStorage: volumeStorage || 'local-lvm',
sharedVolumeStorage: sharedVolumeStorage ? String(sharedVolumeStorage).trim() || null : null,
Comment on lines +73 to 75
| **Shared Volume Storage** | path-backed FS | *(root disk storage)* | Hosts persistent volumes under `<path>/volumes` |

If a configured storage does not support the required content type, the system falls back to the largest enabled storage on the node that does. If no storage supports the required content type, container creation fails.
Comment on lines +83 to +84
is the configured **path** of the node's **shared volume storage** (or the root
disk storage, if shared volume storage is unset) (e.g. a CephFS/NFS mount
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.

2 participants