Hello, @Abhi !
How do I scale my Virtual Machine Scale Set based on custom metrics (like memory)?
After you create your Virtual Machine Scale Set (VMSS), you can go to Monitoring > Metrics
to view metrics (including available memory) and you can go to Availability + scale > Scaling
to set new custom autoscale rules.
- Go to your VMSS
- Go to
Availability + scale > Scaling
- Click on
Custom autoscale
- Under
Scale mode
, selectScale based on a metric
- Click
Add a rule
- Configure the rule using
Current resource
(for built in metrics, like available memory),Azure Monitor workspaces
, or any of the other resources you would like to use. - Set the
Operator
,Metric threshold to trigger scale action
,Duration
,Operation
, andinstance count
to your desired values. - Click
Add
-
Save
your configuration.
Custom autoscale for a VMSS using current resource/Available Memory:
Custom autoscale for a VMSS using Azure Monitor workspaces:
Additional Reading:
- Automatically scale a Virtual Machine Scale Set in the Azure portal
- Send guest OS metrics to the Azure Monitor metric store by using an Azure Resource Manager template for a Windows virtual machine scale set
- FAQ for Azure Virtual Machine Scale Sets
- Azure Monitor autoscaling common metrics
- Supported metrics with Azure Monitor
- Application Insights for Azure VMs and virtual machine scale sets
- Q&A: VMSS autoscaling based on Memory usage in RHEL 8
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!