feat: Add VMSizeProperties support to disable SMT/hyperthreading#1419
Open
fabioaraujopt wants to merge 1 commit intoAzure:mainfrom
Open
feat: Add VMSizeProperties support to disable SMT/hyperthreading#1419fabioaraujopt wants to merge 1 commit intoAzure:mainfrom
fabioaraujopt wants to merge 1 commit intoAzure:mainfrom
Conversation
This PR adds support for Azure VM vCore Customization feature,
allowing users to disable SMT (Simultaneous Multi-Threading, also
known as hyperthreading) on AKS nodes provisioned by Karpenter.
Changes:
- Add VMSizeProperties field to AKSNodeClassSpec API
- Support vCPUsPerCore configuration (1=SMT disabled, 2=SMT enabled)
- Add validation for vCPUsPerCore range (1-2)
- Update VM creation to apply vmSizeProperties to hardwareProfile
- Add comprehensive unit tests for API validation
- Add tests for VM creation with vmSizeProperties
- Generate updated CRDs with new field
Use case:
This feature is particularly useful for:
- CAE (Computer-Aided Engineering) workloads requiring consistent
performance without SMT overhead
- Security hardening by disabling SMT to mitigate certain CPU
vulnerabilities
- Workloads that benefit from dedicated physical cores
Example usage:
```yaml
apiVersion: karpenter.azure.com/v1beta1
kind: AKSNodeClass
metadata:
name: smt-disabled
spec:
imageFamily: AzureLinux
vmSizeProperties:
vCPUsPerCore: 1 # Disables SMT
```
Requirements:
- VM must support hyperthreading (2 threads per core)
- Can only be set at VM creation time
- Requires Azure API version 2021-07-01 or later
Related documentation:
https://learn.microsoft.com/en-us/azure/virtual-machines/vm-customization
Fixes: Feature request for SMT control in Azure Karpenter
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
This PR adds support for Azure VM vCore Customization feature, allowing users to disable SMT (Simultaneous Multi-Threading, also known as hyperthreading) on AKS nodes provisioned by Karpenter.
Changes
VMSizePropertiesfield toAKSNodeClassSpecwithvCPUsPerCoreconfigurationvCPUsPerCorerange (1-2)newVMObjectto applyvmSizePropertiestohardwareProfileUse Cases
This feature is particularly useful for:
Example Usage
Configuration Options
vCPUsPerCore: 1- Disables hyperthreading (1 thread per physical core)vCPUsPerCore: 2- Enables hyperthreading (2 threads per physical core, default)Requirements & Limitations
Testing
vCPUsPerCorerangeconvertVMSizePropertiesfunctionDocumentation
Related Azure documentation:
Related Issues
This addresses the feature gap identified between AWS and Azure Karpenter providers, where AWS EC2NodeClass supports SMT control via userData but Azure AKSNodeClass had no equivalent mechanism.
Checklist: