Design VM Scale Sets
Design VM Scale Sets
If you're still spinning virtual machines up manually, you're doing it wrong. Take a look at how scale sets can make scaling much simpler.
Join the DZone community and get the full member experience.Join For Free
Learn how to migrate and modernize stateless applications and run them in a Kubernetes cluster.
Scale Sets Overview
Scale sets provide high availability to your applications. With virtual machine scale sets, you can build large-scale services for areas such as compute, big data, and container workloads.
In this post, we will discuss design VM Scale Sets.
Why Scale Sets?
To provide redundancy and improved performance, applications are typically distributed across multiple instances.
With scale sets you can create identical, load balanced VMs and manage them centrally.
- Identical means that all VM instances are created from the same base OS image and configuration. This approach lets you easily manage hundreds of VMs without additional configuration tasks or network management.
- Load balancer: Scale sets supports both Azure Load balancer (layer 4) and Application load balancer (layer 7).
- If one of these VM instances has a problem, customers can continue to access your application through one of the other VM instances with minimal interruption.
- The number of VM instances can automatically increase or decrease in response to demand or a defined schedule.
- Scale sets support up to 1000 VM instances. If you create and upload your own custom VM images, the limit is 300 VM instances. Remember this as scale set limit.
- Scale sets provide high availability and resiliency, but as we know, availability, performance, and resilience need to be designed at each level. You can increase the availability by using a managed disk, premium storage, or Availability Zones. All these services are managed by Azure and provide HA and resilience to these services.
- Without a managed disk you need one storage account for every 20 VMs to balance the storage load. This will help you to achieve maximum IO.
- If you use scale sets with Managed Disks instead of traditional storage accounts
- You do not have to pre-create a set of Azure storage accounts for the scale set VMs.
- You can define attached data disks for the VMs in your scale set.
- Scale sets can be configured to support up to 1,000 VMs in a set.
- VMs automatically spread across the vertical fault domains and update domains. So any given point in time when Microsoft is performing updates or maintenance, your services must be up and running.
There are no charges for scale sets features (automation, management). You only need to pay for Azure resources like VMs, Storage, Managed Disks etc.
Scale sets currently default to “overprovisioning” VMs. With overprovisioning turned on, the scale set actually spins up more VMs than you asked for, then deletes the extra VMs once the requested number of VMs are successfully provisioned.
Overprovisioning improves provisioning success rates and reduces deployment time. You are not billed for the extra VMs, and they do not count toward your quota limits.
If your scale set uses user-managed storage, and you turn off overprovisioning, you can have more than 20 VMs per storage account, but it is not recommended to go above 40 for IO performance reasons.
What Are the Management Advantages Compared to VM?
- Add additional VM instances: You need to add, configure VM manually in a group of VMs, whereas in scale sets, it automatically creates them from a central configuration.
- Traffic balancing and distribution: Manual process to add, configure load balancer or application load balance. Scale sets can automatically create and integrate with Azure load balancer or Application Gateway.
- High availability and redundancy: With VMs, you must manually create an Availability Set or distribute and track VMs across Availability Zones, whereas scale sets can automatically distribute VM instances across Availability Zones or Availability Sets.
Opinions expressed by DZone contributors are their own.