Skip to content

feat(launch): --nested-virtualization flag with instance-type validation (#91) - #92

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/nested-virtualization
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/nested-virtualization

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

spawn launch --nested-virtualization runs a hypervisor (KVM/Hyper-V) inside a virtual EC2 instance — hardware-accelerated nested VMs without bare metal (AWS enabled this on virtual C8i/M8i/R8i, Feb 2026, no extra cost). Immediate use: build VMs/AMIs with accelerated qemu/KVM on a cheap virtual instance instead of a ~$4/hr .metal (#83 Windows AMI).

  • LaunchConfig.NestedVirtualization → RunInstances CpuOptions{NestedVirtualization: enabled}.
  • --nested-virtualization flag wired through buildLaunchConfig.
  • Launch-time validation: ValidateInstanceTypeForNestedVirtualization probes DescribeInstanceTypes → ProcessorInfo.SupportedFeatures contains "nested-virtualization" (no hardcoded family list — new families work automatically), mirroring the existing EFA validator. launchWithProgress rejects the flag on an unsupported instance type before spending on a launch, instead of a cryptic RunInstances failure. (Confirmed: c8i/m8i/r8i → supported; c5 → not.)
  • Substrate test for the validator call path.

truffle gets the discovery-filter side separately (truffle#46).

make check green.

Closes #91.

…ion (#91)

Run a hypervisor (KVM/Hyper-V) inside a virtual EC2 instance — hardware-
accelerated nested VMs without bare metal (AWS enabled this on virtual
C8i/M8i/R8i, Feb 2026, no extra cost). Immediate use: build VMs/AMIs with
accelerated qemu/KVM on a cheap virtual instance instead of a ~$4/hr .metal
(#83 Windows AMI).

- LaunchConfig.NestedVirtualization → RunInstances CpuOptions
  {NestedVirtualization: enabled} (pkg/aws/client.go).
- --nested-virtualization launch flag wired through buildLaunchConfig.
- ValidateInstanceTypeForNestedVirtualization: probes DescribeInstanceTypes →
  ProcessorInfo.SupportedFeatures contains "nested-virtualization" (no hardcoded
  family list; new families work automatically), mirroring the existing EFA
  validator. launchWithProgress rejects the flag on an unsupported type BEFORE
  spending on a launch, instead of a cryptic RunInstances error.
- Substrate test for the validator call path (mirrors the EFA substrate test).

truffle gets the discovery-filter side separately (truffle#46).

Closes #91.
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.72973% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/placement.go 41.66% 12 Missing and 2 partials ⚠️
cmd/launch.go 12.50% 6 Missing and 1 partial ⚠️
pkg/aws/client.go 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 2e28dfe into main Jun 9, 2026
3 checks passed
@scttfrdmn
scttfrdmn deleted the feat/nested-virtualization branch June 9, 2026 17:08
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.

spawn launch: --nested-virtualization flag (+ validate instance-type support)

1 participant