Azure VMSS Autoscaling
- Create a VMSS with image from compute gallery with autoscaling
- min: 1
- max: 5
- scale out by 1 if
cpu utilization > 60%
- scale in by 1 if
cpu utilization < 40%
- We have artificially stressed the VM in VMSS using
stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 100m -v
- The instances in VMSS before we started execution are 1, lets wait for 5-10 mins and check for the results
- By default we can scale using host based metrics
- CPU
- RAM
- Disk utilization
- If you need to scale with Application level metrics we can use application insights Refer Here and also from diagnostic extension Refer Here
Rolling updates to VMSS
- Ensure your upgrade policy is not manual.
- Create a new version of the image in compute gallery/image definition and as the upgrade policy is automatic, it should upgrade the vmss with new image version.
- After the image rollout is complete you should be seeing the new image deployed in vmss without downtime.