Add ReadWriteMany (RWX) volume support via NFS#193
Draft
sjmiller609 wants to merge 1 commit intomainfrom
Draft
Conversation
Introduce a volume access mode system with three modes: - ReadWriteOnce (default): single rw or multiple ro, block-backed - ReadOnlyMany: multiple ro only, block-backed - ReadWriteMany: multiple rw/ro via NFS backing NFS volumes don't create local disk images — they store server connection details (server, export path, version, options) in metadata and pass them through to the guest init config. The guest mounts volumes via NFS instead of block devices. Key changes: - Volume domain types: AccessMode enum, NFSConfig struct - Volume manager: RWX-aware attachment rules, NFS creation flow - Instance layer: NFS config propagation, device count skip for NFS - Guest config: "nfs"/"nfs_ro" mount modes with server details - OpenAPI spec: access_mode, nfs fields on create/response - Validation: NFS requires networking, no overlay for NFS volumes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ hypeman-typescript studio · code · diff
✅ hypeman-openapi studio · code · diff
✅ hypeman-go studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
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 support for ReadWriteMany (RWX) volume mounts backed by NFS, allowing multiple VMs to mount the same volume simultaneously for both reading and writing.
Volume Access Modes
Introduces a three-tier access mode system:
ReadWriteOnce(default)ReadOnlyManyReadWriteManyNFS Volume Flow
POST /volumeswithaccess_mode: "ReadWriteMany"andnfs: {server, export_path, ...}— no local disk image created, just metadata"nfs"with server details passed to guest init, which mounts via NFS clientnetwork.enabled=trueon the instanceKey Design Decisions
/dev/vdX) — only metadata + guest configaccess_modedefaults toReadWriteOnce)Files Changed
lib/volumes/types.go—AccessModeenum,NFSConfigstructlib/volumes/manager.go— RWX-aware creation, attachment rules, NFS skip in storage trackinglib/volumes/storage.go— Persisted NFS metadata fieldslib/volumes/errors.go—ErrInvalidRequestlib/instances/types.go—VolumeNFSConfig, updatedVolumeAttachmentlib/instances/configdisk.go— NFS mount config generationlib/instances/create.go— NFS config resolution, validation, device count skiplib/instances/admission.go— Skip NFS in overlay reservationlib/vmconfig/config.go— NFS fields onVolumeMountopenapi.yaml—NFSConfigschema,access_mode/nfson volume endpointslib/oapi/oapi.go— Regeneratedcmd/api/api/volumes.go— API handler NFS/access_mode supportExample: Create an RWX Volume
TODO
mode: "nfs"/mode: "nfs_ro"