Skip to content

[AKS] Mixed sku autoscaling support for VMs agentpool#9808

Open
reneeli123 wants to merge 6 commits intoAzure:mainfrom
reneeli123:reneel/vms-cas-update
Open

[AKS] Mixed sku autoscaling support for VMs agentpool#9808
reneeli123 wants to merge 6 commits intoAzure:mainfrom
reneeli123:reneel/vms-cas-update

Conversation

@reneeli123
Copy link
Copy Markdown
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

Create an AKS cluster with Virtual Machines node pool - Autoscale mode:

az aks create
--resource-group myResourceGroup
--name myAKSCluster
--vm-set-type "VirtualMachines"
--node-vm-size "Standard_D4s_v3"
--enable-cluster-autoscaler
--min-count 2
--max-count 5

Add an autoscaled Virtual Machines node pool to an existing cluster:

az aks nodepool add
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--vm-set-type "VirtualMachines"
--node-vm-size "Standard_D4s_v3"
--enable-cluster-autoscaler
--min-count 2
--max-count 5

Switch from manual to auto mode (converts all manual scale profiles to autoscale profiles with the same min/max):

az aks nodepool update
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--enable-cluster-autoscaler
--min-count 2
--max-count 5

Switch from auto to manual mode (converts all autoscale profiles back to manual scale profiles defaulting node count to minCount):

az aks nodepool update
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--disable-cluster-autoscaler

Add an autoscale profile to an existing VMS pool:

az aks nodepool auto-scale add
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--node-vm-size "Standard_D2s_v3"
--min-count 3
--max-count 5

Update an existing autoscale profile (change VM size and/or min/max count):

az aks nodepool auto-scale update
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--current-node-vm-size "Standard_D2s_v3"
--node-vm-size "Standard_D8s_v3"
--min-count 2
--max-count 4

Delete an existing autoscale profile:

az aks nodepool auto-scale delete
--resource-group myResourceGroup
--cluster-name myAKSCluster
--name myvmpool
--current-node-vm-size "Standard_D2s_v3"

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 wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings April 21, 2026 06:22
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 21, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd aks nodepool auto-scale sub group aks nodepool auto-scale added

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @reneeli123,
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 setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 21, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds mixed-SKU autoscaling management for AKS VirtualMachines agentpools by introducing explicit CLI subcommands to manage individual virtualMachinesProfile.scale.autoscale profiles, and updates existing autoscaler update behavior/docs accordingly.

Changes:

  • Introduces az aks nodepool auto-scale {add,update,delete} commands wired into command table, params, and help.
  • Updates VMs agentpool autoscaler enable/disable behavior to convert between manual and autoscale profiles (supporting multiple profiles).
  • Extends scenario coverage for the new auto-scale commands and conversions.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/custom.py Implements add/update/delete operations for autoscale profiles on VMs agentpools.
src/aks-preview/azext_aks_preview/commands.py Registers the new aks nodepool auto-scale command group.
src/aks-preview/azext_aks_preview/_params.py Adds argument contexts for the new auto-scale subcommands.
src/aks-preview/azext_aks_preview/_help.py Documents new auto-scale commands and clarifies autoscaler flags for VMs pools.
src/aks-preview/azext_aks_preview/agentpool_decorator.py Adjusts VMs autoscaler update/convert logic and blocks --update-cluster-autoscaler for VMs pools.
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Adds scenario steps for auto-scale update/add/delete and manual<->auto conversions.

Comment thread src/aks-preview/azext_aks_preview/_help.py
Comment thread src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py
Comment thread src/aks-preview/azext_aks_preview/agentpool_decorator.py
Comment thread src/aks-preview/azext_aks_preview/custom.py
Comment thread src/aks-preview/azext_aks_preview/custom.py
Comment thread src/aks-preview/azext_aks_preview/custom.py
Copy link
Copy Markdown
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

lgtm

'--update-cluster-autoscaler ' \
'--min-count 1 --max-count 5'
self.cmd(update_nodepool_cmd, checks=[
# update an existing autoscale profile using auto-scale update
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.

Queued live test to validate the change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

seems like it failed with a transient error, re-queued live test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Still failing due to the feature header, added it to all commands and requeued: https://dev.azure.com/msazure/CloudNativeCompute/_build/results?buildId=161656179&view=results

@reneeli123 reneeli123 force-pushed the reneel/vms-cas-update branch from 94ffa5e to 654afe5 Compare April 24, 2026 11:33
@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Apr 24, 2026
reneeli@microsoft.com and others added 3 commits April 24, 2026 23:37
Co-authored-by: Copilot <copilot@github.com>
@reneeli123 reneeli123 force-pushed the reneel/vms-cas-update branch from 654afe5 to 8d22b98 Compare April 24, 2026 11:40
@github-actions github-actions Bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants