Description
What problem are you trying to solve?
Workloads that run nested VMs (e.g. agentic-ai / runtime sandboxing) need to schedule only onto EC2 instance types that support nested virtualization, and eventually launch those instances with nested virtualization enabled.
#8966 covers enabling CpuOptions.NestedVirtualization at launch time. This issue is complementary: a scheduling requirement / instance attribute so NodePools can express "only instance types that support nested virtualization", similar to karpenter.k8s.aws/instance-capability-flex.
Today there is no first-class Karpenter requirement key for this. Consumers must maintain explicit instance-family lists or use out-of-band tooling.
Proposed Karpenter API
Add a requirement label derived from instance type capabilities, e.g.:
requirements:
- key: karpenter.k8s.aws/instance-capability-nested-virtualization
operator: In
values: ["true"]
Karpenter would set the label on each instance type from AWS capability data (true when the type supports nested virtualization, false otherwise), matching the instance-capability-flex pattern.
AWS API mapping (querying supporting instance types)
DescribeInstanceTypes already exposes this via ProcessorInfo.SupportedFeatures:
aws ec2 describe-instance-types \
--filters Name=processor-info.supported-features,Values=nested-virtualization \
--query 'InstanceTypes[].InstanceType' \
--region us-west-2
Reference: Amazon EC2 nested virtualization on virtual instances
GetInstanceTypesFromInstanceRequirements / Fleet
GetInstanceTypesFromInstanceRequirements does not currently expose processor-info.supported-features as an InstanceRequirements field. Options:
- Karpenter-side (short term): resolve instance types via
GetInstanceTypesFromInstanceRequirements, then filter with DescribeInstanceTypes using processor-info.supported-features=nested-virtualization (same approach as hypervisor filters today).
- AWS API enhancement (long term): add nested virtualization support to
InstanceRequirements so Fleet / capacity queries can filter in one call, e.g. a SupportedProcessorFeatures (or similar) parameter on GetInstanceTypesFromInstanceRequirements and EC2 Fleet InstanceRequirements.
Launch-time enablement remains separate and belongs with #8966:
aws ec2 run-instances \
--instance-type m7i.4xlarge \
--cpu-options NestedVirtualization=enabled
How important is this feature to you?
Important for EKS/Karpenter users running nested VM workloads. Without a standard requirement key, every platform team reimplements the same DescribeInstanceTypes filter logic.
Related: #8966
- Please vote on this issue by adding a 👍 reaction to help prioritize
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
What problem are you trying to solve?
Workloads that run nested VMs (e.g. agentic-ai / runtime sandboxing) need to schedule only onto EC2 instance types that support nested virtualization, and eventually launch those instances with nested virtualization enabled.
#8966 covers enabling
CpuOptions.NestedVirtualizationat launch time. This issue is complementary: a scheduling requirement / instance attribute so NodePools can express "only instance types that support nested virtualization", similar tokarpenter.k8s.aws/instance-capability-flex.Today there is no first-class Karpenter requirement key for this. Consumers must maintain explicit instance-family lists or use out-of-band tooling.
Proposed Karpenter API
Add a requirement label derived from instance type capabilities, e.g.:
Karpenter would set the label on each instance type from AWS capability data (
truewhen the type supports nested virtualization,falseotherwise), matching theinstance-capability-flexpattern.AWS API mapping (querying supporting instance types)
DescribeInstanceTypesalready exposes this viaProcessorInfo.SupportedFeatures:aws ec2 describe-instance-types \ --filters Name=processor-info.supported-features,Values=nested-virtualization \ --query 'InstanceTypes[].InstanceType' \ --region us-west-2Reference: Amazon EC2 nested virtualization on virtual instances
GetInstanceTypesFromInstanceRequirements/ FleetGetInstanceTypesFromInstanceRequirementsdoes not currently exposeprocessor-info.supported-featuresas anInstanceRequirementsfield. Options:GetInstanceTypesFromInstanceRequirements, then filter withDescribeInstanceTypesusingprocessor-info.supported-features=nested-virtualization(same approach as hypervisor filters today).InstanceRequirementsso Fleet / capacity queries can filter in one call, e.g. aSupportedProcessorFeatures(or similar) parameter onGetInstanceTypesFromInstanceRequirementsand EC2 FleetInstanceRequirements.Launch-time enablement remains separate and belongs with #8966:
How important is this feature to you?
Important for EKS/Karpenter users running nested VM workloads. Without a standard requirement key, every platform team reimplements the same
DescribeInstanceTypesfilter logic.Related: #8966