Recently, i have been introduced to Azure and i have an application that is using high CPU (almost 80%) during morning hours between 9 am to 1 pm. After that the CPU utilization is reduced to a minimal of 10% the whole day. So in order to reduce my cost i was thinking to implement vertical auto-scaling in my application. When i read more on this i could find automation account and RunBook as the only way but my need is that is there any other way to implement Vertical auto-scaling in Azure IaaS VM apart from automation account? If Yes, please share the approach.
Asked
Active
Viewed 1,955 times
1 Answers
1
Yes you can use Azure PowerShell and/or the Azure CLI to execute scaling commands on a VM. Here are some PowerShell examples: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/resize-vm?toc=%2Fazure%2Fvirtual-machines%2Fwindows%2Ftoc.json
You would then just have to schedule the script to run either locally or in an Azure service like Functions, Container Instances or etc.
If you wanted to scale vertically a single VM based on a performance metric (CPU, memory, etc.) you can use the classic metric alerts system to do that. When those alerts fire based on thresholds you set you can invoke a webhook OR Logic App to trigger execution of a script or ARM Template.

KWilson
- 709
- 5
- 8
-
Thanks Wilson, but my requirement is to implement autoscaling but your link shared helps in resizing. By auto-scaling, i meant my application can get an alert and then resize itself on the basis of an alert. I understand that we can set alert through ARM template but my need is can we implement auto-scaling as well using ARM template ? – Puneet May 24 '18 at 14:29
-
Ok, so are you asking can you get an alert for CPU threshold on a VM and then have that alert trigger a process for scaling up the VM? (Sidenote: I assume your original question was based on this Article: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-vertical-scale-reprovision) – KWilson May 24 '18 at 15:02
-
Yes Wilson, you got my question correct this time.And the link you shared is of VMSS that can be a good option in case of Horizontal scaling but my requirement is vertical scaling. – Puneet May 24 '18 at 15:08
-
@Puneet You can set an alert on a VM based on the CPU % and then have that alert trigger either an email, generic webhook or a Logic App. Logic Apps has a built in Azure Resource Manager connector (in Preview) which can be used to manipulate Azure resources directly or through ARM templates. So for your scenario you would have the Alert trigger the Logic App based on CPU threshold, then have the Logic App run an ARM template that either scaled up or down the VM based on the need. https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-alerts – KWilson May 24 '18 at 19:28