Skip to content

fix: correct sku-cpu label for Harvest VMs using actual core count#8611

Open
goiri wants to merge 1 commit into
Azure:mainfrom
goiri:fix/harvest-sku-cpu-nproc
Open

fix: correct sku-cpu label for Harvest VMs using actual core count#8611
goiri wants to merge 1 commit into
Azure:mainfrom
goiri:fix/harvest-sku-cpu-nproc

Conversation

@goiri
Copy link
Copy Markdown

@goiri goiri commented May 30, 2026

Problem

Harvest VMs expose more physical cores than the nominal vCPU count reported by CRP SKU API (e.g., harvest_e8s_v3 reports 8 but guest sees 16). This causes kubernetes.azure.com/sku-cpu to be wrong, leading to scheduling mismatches.

Fix

Before kubelet starts, compare the RP-provided sku-cpu label against the actual core count from the OS:

  • Linux: nproc in cse_helpers.sh
  • Windows: Win32_ComputerSystem.NumberOfLogicalProcessors in kubeletfunc.ps1

If they differ, correct the label. Generic - works for any SKU with a mismatch, not just Harvest.

Testing

  • Added shell spec tests (Linux) and Pester tests (Windows)
  • Verified on live harvest_e8s_v3 node: /proc/cpuinfo shows 16 cores, label was 8

Harvest VMs expose more physical cores to the guest OS than the nominal
vCPU count reported by the CRP SKU API (e.g., harvest_e8s_v3 reports 8
but the guest sees 16). This causes the kubernetes.azure.com/sku-cpu
label to be incorrect, leading to scheduling mismatches.

Linux: Add fixSkuCpuLabel() to cse_helpers.sh that compares the
RP-provided sku-cpu label against nproc output and corrects it before
kubelet starts.

Windows: Add Fix-SkuCpuLabel to kubeletfunc.ps1 that compares against
Win32_ComputerSystem.NumberOfLogicalProcessors and corrects the label
in kubeletstart.ps1 before kubelet args are built.

Both approaches are generic and work for any SKU where the CRP-reported
vCPU count doesn't match the actual cores visible to the OS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant