
Introduction
Virtual Machine Scale Sets (VMSS) are a widely used technology in cloud-based applications. This technology is designed to automatically scale and manage a set of virtual machines. In this article, we will provide a detailed description of the upgrade policies available for VMSS.
Upgrade Policies
Upgrade policies for VMSS are divided into three main categories: Automatic, Manual, and Rolling. Each policy has its own advantages and application areas.
Automatic Upgrade Policy
In an automatic upgrade policy, VMSS makes no guarantees about the order in which virtual machines are upgraded. In this policy, all virtual machines can be stopped and upgraded at the same time. The automatic upgrade policy is mainly suitable for DevTest scenarios, where the uptime of the instances is not important.
Manual Upgrade Policy
In a manual upgrade policy, the user controls the upgrade process. In this policy, when new instances are added, they use the latest model, but existing virtual machines are not automatically upgraded. A manual upgrade policy is more suitable for workloads where you want to control how and when instances are upgraded.
Rolling Upgrade Policy and MaxSurge
In a rolling upgrade policy, VMSS performs upgrades in batches. In this policy, you have more control over the upgrade process: batch size, maximum healthy percentage, prioritization of sick instances, and enabling upgrades in different availability zones. Additionally, by enabling MaxSurge, new virtual machines can be created to replace virtual machines that use the old model with new ones. MaxSurge allows you to maintain VMSS capacity without reducing capacity during the upgrade.
A rolling upgrade policy is the most suitable policy for production workloads that require a certain number of instances to be available at all times. This policy is the safest way to implement upgrades without compromising availability and uptime.
Conclusion
VMSS upgrade policies provide users with options that are suitable for different scenarios. The automatic upgrade policy is more suitable for DevTest scenarios, while the manual policy is ideal for workloads that require more control. The rolling upgrade policy is the safest and most efficient way for production workloads. Using these policies, you can upgrade your virtual machines to the latest model while maintaining service availability and uptime.