Skip to content

feat(vmm): add static configuration validation - #906

Merged
kvinwang merged 4 commits into
masterfrom
codex/feat-vmm-config-validation
Aug 4, 2026
Merged

feat(vmm): add static configuration validation#906
kvinwang merged 4 commits into
masterfrom
codex/feat-vmm-config-validation

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a side-effect-free check-config command for validating static configuration invariants.

The extended checks run only when check-config is explicitly requested, so existing serve and run behavior is unchanged. The pre-existing host API validation remains part of normal startup.

Validation performed

  • Require a valid vsock:<cid> host API address and a nonzero host API port.
  • Parse the Rocket management API address and port.
  • Validate the guest CID pool bounds and prevent range overflow.
  • Restrict host share mode to 9p, vhd, or vvfat.
  • Reject zero enabled auto-restart intervals and reversed port-mapping ranges.
  • Validate MAC prefixes and mode-specific bridge/custom networking fields.
  • Reject empty required Supervisor paths and an empty executable when auto-start is enabled.
  • Require KMS, Gateway, PCCS, and NVIDIA proxy endpoints to be valid HTTP(S) URLs with hosts.

The checks are intentionally limited to static invariants. They do not access external services, require host devices, or mutate host state.

Usage

dstack-vmm --config /etc/dstack-vmm.toml check-config

A valid configuration prints configuration is valid; an invalid one exits with an error.

Tests

  • cargo test --manifest-path dstack/Cargo.toml -p dstack-vmm config::tests::
  • cargo check --manifest-path dstack/Cargo.toml -p dstack-vmm
  • cargo fmt --manifest-path dstack/Cargo.toml --all
  • git diff --check

Copilot AI review requested due to automatic review settings July 31, 2026 03:05

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang kvinwang changed the title feat(vmm): add a configuration validation command feat(vmm): add static configuration validation Aug 4, 2026
@kvinwang
kvinwang merged commit 0959542 into master Aug 4, 2026
15 checks passed
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