Repository navigation
fix(vmm): use host kms_url for single-node SEV-SNP app epoch and env encryption - #1708
Open
PierreLeGuen wants to merge 3 commits into
Open
PierreLeGuen wants to merge 3 commits into
PierreLeGuen wants to merge 3 commits into
Conversation
On SEV-SNP launches with a 0.6.7+ guest image (app_epoch_pin: true), the VMM queries the KMS from the host to resolve the current app epoch before starting QEMU. Under single-node user-mode networking (as configured by dstackup), cvm.kms_urls holds the guest-only 10.0.2.2 alias, which is not routable from the host. When the VM manifest does not override kms_urls, try the host-side top-level kms_url first and fall back to cvm.kms_urls (deduplicated). Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
dstackup install writes cvm.kms_urls with the QEMU user-mode guest alias (https://10.0.2.2:<port>), which is not routable from the host, and left the top-level host kms_url empty. Set kms_url = https://127.0.0.1:<port> when KMS is enabled so host-side VMM RPCs (app-epoch resolution on 0.6.7 SEV-SNP launches and env-key lookups) can reach the local KMS. Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
create_vm rejected --env-file when --kms-url was omitted even if --kms-encrypt-url was given (unlike update_vm, which already allowed it). Allowing --kms-encrypt-url without --kms-url lets single-node hosts encrypt envs against the host-side KMS without overriding cvm.kms_urls on the VM. Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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
On single-node VMM hosts using QEMU user-mode networking (as configured by
dstackup),cvm.kms_urlsholds the guest-only10.0.2.2alias, which is not routable from the host. Host-side VMM RPCs (resolving the current app epoch forapp_epoch_pin: trueSEV-SNP launches on 0.6.7+ images) andvmm-cli.pyenv encryption need the host-reachable KMS URL without overriding guestcvm.kms_urls.Changes
fix(vmm): prefer host kms_url when querying SEV-SNP app epoch(dstack/vmm/src/app/mr_config.rs): whenmanifest.kms_urlsis unset, try top-level hostkms_urlfirst and fall back tocvm.kms_urls(deduplicated).fix(dstackup): set host kms_url in vmm.toml(dstack/crates/dstack-cli-core/src/config.rs,dstack/crates/dstackup/src/install.rs): set top-levelkms_url = "https://127.0.0.1:<port>"alongside guestcvm.kms_urlswhen KMS is enabled.fix(vmm-cli): allow --env-file with --kms-encrypt-url alone(dstack/vmm/src/vmm-cli.py,dstack/vmm/src/tests/test_vmm_cli.py): matchupdate_vmsocreate_vmaccepts--env-filewith--kms-encrypt-urlwithout requiring--kms-url.Verification
cargo test --locked -p dstack-vmm mr_config(7 passed) andcargo test --locked -p dstack-cli-core -p dstackup(18 + 31 passed).cargo clippy --locked -p dstack-vmm -p dstack-cli-core -p dstackup -- -D warnings --allow unused_variablesandcargo fmt --all -- --check: pass.python -m unittest tests/test_vmm_cli.py -v: 23/23 passed.Split out from #1703.