Skip to content

feat: Add nested_virtualization cpu_option#3686

Merged
bryantbiggs merged 6 commits into
terraform-aws-modules:masterfrom
xstodu07:3685-add-nested-virtualization-cpu-option
May 29, 2026
Merged

feat: Add nested_virtualization cpu_option#3686
bryantbiggs merged 6 commits into
terraform-aws-modules:masterfrom
xstodu07:3685-add-nested-virtualization-cpu-option

Conversation

@xstodu07

@xstodu07 xstodu07 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Description

Nested virtualization is included in the aws provider since 6.33.0, and is supported on C8i, M8i, and R8i instancecs.

Motivation and Context

Breaking Changes

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Nested virtualization is included in the aws provider since 6.33.0,
and is supported on C8i, M8i, and R8i instancecs.

Implements: terraform-aws-modules#3685
Signed-off-by: Tomas Stodulka <tomas.stodulka@enverus.com>
@bryantbiggs

Copy link
Copy Markdown
Member

all of the versions throughout will need to be bumped to the min supported version for this

version = ">= 6.28"

@acolombier

Copy link
Copy Markdown

Tested and doesn't work unfortunately. It would seems EKS is dropping the CPU option according to this findings here. Haven't tried the AI-suggested workaround yet.

@xstodu07

Copy link
Copy Markdown
Contributor Author

@acolombier just got it deployed also with eks-managed-node-group and it is as you say :(

Comment thread modules/eks-managed-node-group/main.tf
@acolombier

Copy link
Copy Markdown

I can confirm it works with the self-managed module, tho you need to port the feature there as cpu_option don't have the nested_virtualization!

@acolombier

Copy link
Copy Markdown

Are you interested in also adding this feature to the self managed module @xstodu07 ? Here is the patch for it:

diff --git a/modules/self-managed-node-group/main.tf b/modules/self-managed-node-group/main.tf
index 3958fad..5c96a93 100644
--- a/modules/self-managed-node-group/main.tf
+++ b/modules/self-managed-node-group/main.tf
@@ -194,6 +194,7 @@ resource "aws_launch_template" "this" {
       amd_sev_snp      = cpu_options.value.amd_sev_snp
       core_count       = cpu_options.value.core_count
       threads_per_core = cpu_options.value.threads_per_core
+      nested_virtualization  = cpu_options.value.nested_virtualization ? "enabled" : "disabled"
     }
   }
 
diff --git a/modules/self-managed-node-group/variables.tf b/modules/self-managed-node-group/variables.tf
index 6e42508..8ffde80 100644
--- a/modules/self-managed-node-group/variables.tf
+++ b/modules/self-managed-node-group/variables.tf
@@ -227,6 +227,7 @@ variable "cpu_options" {
     amd_sev_snp      = optional(string)
     core_count       = optional(number)
     threads_per_core = optional(number)
+    nested_virtualization = optional(bool)
   })
   default = null
 }

@bryantbiggs

Copy link
Copy Markdown
Member

if you want to add this for self-managed, we can merge this and then whenever EKS managed node group starts respecting the values it will work for MNG

@KrawczowaKris

Copy link
Copy Markdown

@bryantbiggs Would it be possible to prioritize or speed up the review/merge of this PR?

@bryantbiggs

Copy link
Copy Markdown
Member

please fix the conflicts when you get a chance

@csantanapr

Copy link
Copy Markdown
Contributor

EKS managed node group now respect this values, it was recently fixed

@bryantbiggs

Copy link
Copy Markdown
Member

thanks @csantanapr !!!

@xstodu07 can you update and fix the conflicts when you get a chance?

@bryantbiggs bryantbiggs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@bryantbiggs bryantbiggs merged commit ddec8b9 into terraform-aws-modules:master May 29, 2026
22 checks passed
antonbabenko pushed a commit that referenced this pull request May 29, 2026
## [21.23.0](v21.22.0...v21.23.0) (2026-05-29)

### Features

* Add nested_virtualization cpu_option ([#3686](#3686)) ([ddec8b9](ddec8b9)), closes [#3685](#3685)
* Add support for launch template `network_performance_options` ([#3714](#3714)) ([9be4cbd](9be4cbd))
@antonbabenko

Copy link
Copy Markdown
Member

This PR is included in version 21.23.0 🎉

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.

6 participants