Skip to content

fix: align OS disk sizing with AKS when osDiskSizeGB is unset - #1973

Merged
Robin D. (comtalyst) merged 9 commits into
fix/trusted-launch-ephemeral-os-reservefrom
fix/auto-size-os-disk-stacked
Oct 10, 2026
Merged

Robin D. (comtalyst) merged 9 commits into
fix/trusted-launch-ephemeral-os-reservefrom
fix/auto-size-os-disk-stacked

Conversation

@comtalyst

@comtalyst Robin D. (comtalyst) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on: #1869

Stacked copy of: #1723

Fixes Azure/AKS#5503

Description

When osDiskSizeGB is omitted, prefer an ephemeral OS disk at the SKU-supported size (capped at 2040GB).
SKUs without ephemeral support fall back to managed disk defaults by vCPU count (128/256/512/1024GB).
VM and AKS Machine API paths consume the same resolved profile, and reported ephemeral-storage capacity matches the provisioned size.
Explicit values remain bounded to 30-2048GB.

Official reference:
https://learn.microsoft.com/en-us/azure/aks/concepts-storage#default-os-disk-sizing

If you select a virtual machine (VM) SKU that supports Ephemeral OS disks but don't specify an OS disk size, AKS by default provisions an Ephemeral OS disk with a size that scales according to the total temp storage of the VM SKU so long as the temp is at least 128 GiB.

When you create a new cluster or add a new node pool to an existing cluster, the number for vCPUs determines the OS disk size by default.
image

How was this change tested?

  • Private AKS cluster, with multiple SKU types (original PR validation).
  • NAP E2E β€” full CheckIn in MachineAPI mode
  • NAP E2E β€” full CheckIn in BootstrappingClient mode

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note

Aligns OS disk sizing with AKS when osDiskSizeGB is unset

Flattened from #1723 onto the #1870 -> #1869 stack.

Retains fit-aware placement, explicit Managed behavior, and the Trusted Launch one-GiB reserve while applying the original per-SKU auto-sizing behavior.

Co-authored-by: Robin Deeboonchai <rdeeboonchai@microsoft.com>
# Conflicts:
#	pkg/providers/instancetype/instancetypes.go
Copilot AI balanced review requested due to automatic review settings October 9, 2026 00:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

πŸ”΅ Needs a closer look

It changes API defaulting and storage provisioning across both Azure provisioning paths while depending on another stacked fix.

0 open findings

What changed in this PR

Aligns unset OS disk sizing with AKS defaults across VM and AKS Machine API provisioning.

Changes:

  • Resolves per-SKU ephemeral or vCPU-based managed disk profiles.
  • Uses resolved sizes for provisioning and advertised capacity.
  • Updates CRDs and adds unit, acceptance, and E2E coverage.
File Description
test/​suites/​nodeclaim/​eph_osdisk_test.go Adds auto-sizing E2E coverage.
pkg/​test/​nodeclass.go Leaves test disk size unset.
pkg/​providers/​instancetype/​suite_test.go Tests sizing, placement, and capacity.
pkg/​providers/​instancetype/​instancetypes.go Implements shared disk-profile resolution.
pkg/​providers/​instancetype/​instancetype.go Reports resolved storage capacity.
pkg/​providers/​instancetype/​instancetype_test.go Adapts test parameters to pointer sizing.
pkg/​providers/​instance/​vminstance.go Sends the resolved VM disk size.
pkg/​providers/​instance/​aksmachineinstancehelpers.go Sends resolved Machine API disk settings.
pkg/​providers/​imagefamily/​resolver.go Populates launch templates from resolved profiles.
pkg/​cloudprovider/​suite_aksmachineapi_features_test.go Covers Machine API auto-sizing.
pkg/​apis/​v1beta1/​crd_validation_cel_test.go Tests unset and invalid sizing.
pkg/​apis/​v1beta1/​aksnodeclass.go Removes the 128 GB default.
pkg/​apis/​v1alpha2/​crd_validation_cel_test.go Updates legacy validation tests.
pkg/​apis/​v1alpha2/​aksnodeclass.go Mirrors sizing documentation.
pkg/​apis/​crds/​karpenter.azure.com_aksnodeclasses.yaml Updates generated CRD schemas.
charts/​karpenter-crd/​templates/​karpenter.azure.com_aksnodeclasses.yaml Updates generated chart CRDs.

🧠 Review effort: Balanced


πŸ’‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Looks good.

/yet-another-code-review found no additional findings.

Carry forward the current-main load-balancer exclusion behavior and Windows/Cilium E2E guard through the stack. Preserve every added and removed line of PR1973's reviewed OS disk autosizing delta.
@comtalyst
Robin D. (comtalyst) merged commit 58138da into main Oct 10, 2026
14 checks passed
@comtalyst
Robin D. (comtalyst) deleted the fix/auto-size-os-disk-stacked branch October 10, 2026 20:21
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.

[Feature] OSDiskSizeGB set to max available by default in NAP

5 participants