Skip to content

[aks-preview] Fix managed GPU autoscaler configuration updates - #10343

Merged
Julie Zhu (yanzhudd) merged 3 commits into
Azure:mainfrom
ganeshkumarashok:fix/managed-gpu-ca-preserve-mode
Sep 17, 2026
Merged

Julie Zhu (yanzhudd) merged 3 commits into
Azure:mainfrom
ganeshkumarashok:fix/managed-gpu-ca-preserve-mode

Conversation

@ganeshkumarashok

@ganeshkumarashok Ganeshkumar Ashokavardhanan (ganeshkumarashok) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes
️✔️ None

Related command

az aks nodepool update

Description

Preserve the existing GPU management mode when --enable-managed-gpu is omitted.

The update handler currently defaults this three-state option to False. The managed-GPU decorator correctly treats None as "leave unchanged" and False as "set Unmanaged", so an unrelated update silently changes an existing managed GPU pool to Unmanaged in the outgoing request. Because the GPU management mode is immutable, the service rejects the request with:

(PropertyChangeNotAllowed) Changing property
'properties.gpuProfile.nvidia.managementMode' is not allowed.

This includes enabling, changing the bounds of, or disabling Cluster Autoscaler, as well as updating labels or tags.

Change the update-only default to None. Explicit true/false inputs and node-pool creation defaults remain unchanged. This does not relax service-side GPU-profile immutability.

Validation

  • Reproduced the issue through the real command handler and full update decorator, capturing the SDK request with the network client mocked: a CA-only update changed Managed to Unmanaged.
  • Before the fix, the new handler regression cases produced 14 failures covering CA enable/update/disable and metadata-only updates.
  • After the fix: 5 tests, 23 subtests passed under pytest; the same tests also pass with unittest.
  • Exercised the actual command loader and Azure CLI parser: omitted option -> None; bare option or explicit true -> True; explicit false -> False.
  • Coverage asserts the complete GPU profile is preserved, including existing MIG and driver-mode fields, and retains explicit inputs and non-GPU behavior.
PYTHONPATH=src/aks-preview python -m unittest \
  azext_aks_preview.tests.latest.test_agentpool_update -v

PYTHONPATH=src/aks-preview python -m pytest \
  src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_update.py -q

Scope

This fixes unintended GPU-profile mutation in the CLI configuration path. Preservation of existing MIG/DRA fields is not a claim that those configurations support every autoscaling scenario. This PR does not change the published managed-GPU support policy, GPU resource discovery, scale-from-zero behavior, or upstream autoscaler implementation.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema.

The release note is in HISTORY.rst's Pending section, following that file's guidance. No version or extension index changes are included.

Keep omitted --enable-managed-gpu distinct from explicit false so autoscaler and metadata updates do not mutate the immutable GPU profile. Add handler and parser regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 15, 2026 23:35
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Ganeshkumar Ashokavardhanan (@ganeshkumarashok),
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟢 Approval recommended

The changes are covered by regression tests and no unresolved blocking issues remain.

Pull request overview

Fixes az aks nodepool update so omitted --enable-managed-gpu preserves the existing GPU profile.

Changes:

  • Uses None as the update-only default.
  • Adds regression and parser tests.
  • Documents the fix in release notes.
File summaries
File Description
src/aks-preview/HISTORY.rst Adds the release note.
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_update.py Adds regression and parser coverage.
src/aks-preview/azext_aks_preview/custom.py Preserves omitted managed-GPU settings during updates.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

FumingZhang
FumingZhang previously approved these changes Sep 16, 2026
Comment thread src/aks-preview/HISTORY.rst
@FumingZhang

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@yanzhudd
Julie Zhu (yanzhudd) merged commit 59dd82d into Azure:main Sep 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants