Azure

Azure VMSS Complete Guide: Uniform/Flexible, Auto Scale, Rolling Upgrade & Spot Mix

2026-05-24
NicheeLab Editorial Team

Virtual Machine Scale Sets (VMSS) is an Azure service that auto-scales, auto-deploys, and auto-heals 1-1000 identically configured VMs. It is widely used for web tiers, batch workers, and AKS node pools (internal implementation), making it one of Azure's flagship compute services. This article exhaustively organizes VMSS Orchestration modes, Auto Scale, Custom Images, Upgrade Policies, and Spot mixing.

Uniform vs Flexible Orchestration Mode

ItemUniform (Legacy)Flexible (Current mainstream, GA 2021)
InstancesIdentical config onlyMixed VM sizes and Images
Max instances10001000
AZ redundancySupportedSupported (finer-grained control)
Spot + Regular mixNot supportedSupported (Spot Priority Mix)
Auto ScaleFastFlexible
Use caseStateless web tierRecommended for new, complex configs

New VMSS deployments should use Flexible mode. AKS node pools internally use VMSS Flexible.

Configuring Auto Scale

Configured via Azure Monitor Auto Scale.

Rule types

  • Metric-based: CPU usage, memory usage, network I/O, etc. (most common)
  • Schedule-based: time-of-day (e.g., scale up only weekdays 9-18)
  • Custom Metric: Application Insights custom metrics (e.g., queue length, requests/sec)

Standard rule examples

ConditionAction
CPU > 70% for 5 min+1 instance (Scale Out)
CPU < 30% for 10 min-1 instance (Scale In)
Cooldown Period5 min (prevents repeated scaling)
Min Instances2 (HA guarantee)
Max InstancesWithin budget ceiling

Custom Images and Azure Compute Gallery

ItemMarketplace ImageCustom Image
ProviderMicrosoft / OS vendorBuilt by organization
UpdatesMonthly security patchesManaged by organization
Deploy speedSlow with Script ExtensionFast (preinstalled)
ConsistencyBuilt via ScriptGuaranteed identical across all instances
ManagementNot requiredCentralized in Azure Compute Gallery

Azure Compute Gallery (formerly Shared Image Gallery) supports cross-region replication and version management. For new organizations, the modern operating pattern is to start with Marketplace + Custom Script Extension, then migrate to Custom Images once stable, and automate Image builds in a CI/CD pipeline with Azure Image Builder.

Upgrade Policy

ModeBehaviorWhen to use
ManualAdmin manually upgradesHighest-stakes requirements, staged verification
AutomaticUpgrades all instances at onceNot recommended for production (downtime)
RollingUpgrades batch by batchProduction standard

Rolling Upgrade Settings

  • Batch Size: 20% recommended
  • Pause Time Between Batches: 5-15 min
  • Max Surge: temporarily increase capacity for zero-downtime
  • Application Health Extension: reports health info to VMSS, improving anomaly detection

Spot + Regular Mix Patterns

A powerful feature of Flexible mode. You can mix Spot VMs and regular VMs within a single VMSS.

Spot Priority Mix

  • Regular 30% + Spot 70%: balanced cost optimization
  • Regular 0% + Spot 100%: batch processing (re-run jobs on stop)
  • Regular 50% + Spot 50%: high availability + cost reduction

When a Spot VM is evicted, it is automatically replenished with a regular VM. Setting the max Spot price up to pay-as-you-go reduces eviction frequency, balancing cost savings and stability.

High Availability (HA) Design

  • Availability Zone (AZ) spread: spread instances across multiple AZs, SLA 99.99%
  • Min Instances >= 2: HA guarantee
  • Fault Domain spread: handles physical failures within the same datacenter
  • Application Health Extension: auto-replace unhealthy instances
  • Application Gateway / Load Balancer integration: traffic distribution
  • Zone Redundant Storage (Premium SSD ZRS): disk-level redundancy

Typical Use Cases

Use caseConfiguration
Web tier auto-scalingUniform mode + Load Balancer + Auto Scale (CPU)
Batch processing workersFlexible mode + Spot 100% + Custom Metric (queue length)
AKS Node PoolFlexible mode (internal implementation)
SAP HANA Scale-outUniform mode + Proximity Placement Group
Game serversFlexible mode + Spot Mix + Custom Metric (player count)

Design Pitfalls

  1. Forgetting Custom Image update management: automate updates with Image Builder + CI/CD
  2. Setting Auto Scale Min Instance to 1 and losing HA: require >= 2 + AZ redundancy
  3. Running stateful apps (DB) on VMSS: stateless only; store state in external storage
  4. Rolling Upgrade without Health Probe: unhealthy instances marked Healthy
  5. Using Spot VMs for production stateful workloads: eviction causes outages
  6. Upgrade Policy set to Automatic causes service outage
  7. Subnet IP exhaustion: a /24 cannot hold 1000 instances
  8. Ignoring Custom Script Extension failures: set up alerts on failures
  9. Skipping Reserved Instances and ballooning pay-as-you-go costs

Operational Best Practices

  1. Flexible Orchestration mode for new projects
  2. AZ redundancy + Min 2 instances for HA guarantee
  3. Manage Custom Images in Azure Compute Gallery, auto-update with Image Builder
  4. Rolling Upgrade + Application Health Extension for zero-downtime deployments
  5. Optimize cost for production stateless workloads with Spot Priority Mix
  6. Reserved Instance (purchase for steady baseline load)
  7. Leverage Auto Scale Custom Metric (queue length, requests/sec)
  8. Send Diagnostic Logs to Log Analytics, Sentinel monitoring
  9. Set subnet size to /22 or larger (future scale headroom)
  10. Periodic Image refreshes + Custom Script Extension testing

Related Certifications

Frequently Asked Questions

What is VMSS?

Virtual Machine Scale Sets (VMSS) is the Azure service that auto-scales, auto-deploys, and auto-heals 1-1000 identically configured VMs. Auto Scale adjusts instance count based on demand (CPU utilization or custom metrics), while deployments are standardized via ARM/Bicep templates or a Custom Image. Integrated with Azure Load Balancer / Application Gateway for traffic distribution, VMSS achieves a 99.99% SLA with AZ redundancy. Typical use cases: auto-scaling web tiers, batch processing workers, AKS node pools (internal implementation), and SAP HANA scale-out. VMSS is one of Azure's flagship compute services, enabling far larger and more fault-tolerant operations than standalone VMs.

What is the difference between Uniform mode and Flexible mode?

Uniform Orchestration mode (legacy): every instance has identical configuration (Image, Size, Network), max 1000 instances, with fast Auto Scale. The original VMSS approach, suitable for web tiers and stateless workloads. Flexible Orchestration mode (GA 2021, today's mainstream): each instance is treated as an independent VM resource, allowing mixed VM sizes and Images, max 1000 instances, and more flexible overall. It enables fine-grained AZ redundancy and Fault Domain control, and supports node pools mixing Spot and regular VMs. Flexible mode is recommended for new VMSS deployments, and Microsoft itself recommends migrating from Uniform to Flexible. AKS node pools internally use VMSS Flexible.

How do you configure Auto Scale?

Configured via Azure Monitor Auto Scale. Rule types: 1) Metric-based (CPU usage, memory usage, network I/O, etc., the most common), 2) Schedule-based (time-of-day based, e.g., scale up only weekdays 9-18), 3) Custom Metric (Application Insights custom metrics, e.g., queue length, requests/sec). Standard pattern: scale out +1 instance after 5 minutes of CPU > 70%, scale in -1 instance after 10 minutes of CPU < 30%. A Cooldown Period (default 5 min) prevents repeated scaling, and Min / Max Instances set safe bounds. Best practice in production is Min >= 2 (HA guarantee) and Max within your budget ceiling.

When should you use Custom Image vs Marketplace Image?

Marketplace Image: standard images supplied by Microsoft or OS vendors (Ubuntu 22.04, Windows Server 2025, etc.), with monthly security patch updates so new instances always get the latest patches. Custom Image: organization-built proprietary images (with apps, middleware, and config preinstalled), centrally managed in Azure Compute Gallery (formerly Shared Image Gallery) with cross-region replication and versioning. Benefits include faster deployment (several times faster than Marketplace + Custom Script Extension) and consistency (guaranteed identical configuration across all instances). The modern operating pattern is for new organizations to start with Marketplace Image + Custom Script Extension, transition to Custom Images once stable, and automate image builds via Azure Image Builder in a CI/CD pipeline.

What are the Manual / Automatic / Rolling Upgrade Policies?

Manual: administrators manually upgrade each instance, most cautious but highest operational overhead. Automatic: upgrades all instances at once, causing downtime, not recommended for production. Rolling: upgrades in batches (e.g., 20% at a time), with the Application Health Probe verifying each batch before proceeding, minimizing downtime. Rolling is the only realistic choice for production: configure Batch Size (20% recommended), Pause Time Between Batches (5-15 min), and Max Surge (temporarily increase capacity for zero-downtime). Installing the Application Health Extension on instances so they can report health to VMSS improves anomaly detection accuracy during Rolling Upgrade.

How do you mix Spot and regular VMs in VMSS Flexible?

One of the powerful features of Flexible Orchestration mode. You can mix Spot VMs and regular VMs within a single VMSS using Spot Priority Mix (e.g., 30% regular + 70% Spot). When a Spot VM is evicted, it is automatically replenished with a regular VM. Cost optimization scenarios: 1) stateless web tier with 70% Spot + 30% regular (~50% cost reduction, service continuity even with partial eviction), 2) batch processing with 100% Spot (re-run jobs on stop), 3) AKS node pool mixing Spot and regular. Setting the max Spot price up to pay-as-you-go reduces eviction frequency, striking a balance between cost savings and stability.

What are common VMSS pitfalls?

Common pitfalls: 1) forgetting to update Custom Images and running on stale OS/apps (automate updates with Image Builder + CI/CD), 2) setting Auto Scale Min Instance to 1 and losing HA (require >= 2 + AZ redundancy), 3) running stateful apps (DB) on VMSS (stateless only; store state in external storage), 4) Rolling Upgrade without a configured Health Probe, so unhealthy instances are deemed Healthy and the service goes down, 5) using Spot VMs for production stateful workloads (eviction causes outages), 6) Upgrade Policy set to Automatic causing service outage, 7) subnet IP exhaustion (a /24 cannot hold 1000 instances), 8) ignoring Custom Script Extension failures (set up alerts on failures), 9) skipping Reserved Instances and ballooning pay-as-you-go costs. Considering these at design time dramatically reduces operational burden.

What related certifications cover VMSS?

AZ-104 (Administrator) goes deep on VMSS in Domain 3 (Compute, 20-25%), making it the headline certification for this area. AZ-305 (Solutions Architect Expert) covers Auto Scale design from an architect perspective, AZ-204 (Developer Associate, retiring 2026-07) covers VMSS deployments from a developer angle, AZ-400 (DevOps Engineer Expert) covers automating VMSS Image updates from CI/CD pipelines, and AZ-140 (AVD Specialty) covers AVD host pools (internally VMSS). AKS node pools are built on internal VMSS. Understanding VMSS is an essential skill for any Azure compute engineer.

Related articles and deep dives

Azure Policy 完全ガイド|Effect・Built-in/Custom・Initiative・Remediation・コンプライアンス【2026 年版】

Azure Policy の完全ガイド。Effect 7 種類 (Deny/Audit/Modify/DeployIfNotExists/Append/AuditIfNotExists/Disabled) の使い分け、Built-in vs Custom Policy、Initiative (Policy Set)、Assignment Scope、Remediation、Microsoft Cloud Security Benchmark コンプライアンス活用、関連認定試験 (AZ-104 / SC-100 / AZ-305) を日本語で網羅。

Azure Spot VM 詳細ガイド|Eviction Policy・Max Price・Placement Score・AKS Spot Node Pool【2026 年版】

Azure Spot VM の詳細ガイド。Eviction Policy (Deallocate / Delete) 選択・Max Price 戦略・Spot Placement Score・制約・AKS Spot Node Pool 構成・コスト効果・運用ベストプラクティス・関連認定試験 (AZ-104 / AZ-305 / AZ-400) を日本語で網羅。最大 90% コスト削減の実装パターン。

Azure Backup 完全ガイド|RSV / Backup Vault・Backup Policy・Immutable Backup・コスト最適化【2026 年版】

Azure Backup の完全ガイド。Recovery Services Vault vs Backup Vault の使い分け、Backup Policy 設計、Azure VM / Files / SQL / Blob Backup の動作、Immutable Backup・Multi-User Authorization によるランサムウェア対策、コスト最適化、関連認定試験 (AZ-104 / AZ-305 / SC-100) を日本語で網羅。

Azure DevOps エンジニア キャリアロードマップ|AZ-104 → AZ-400 → SC-100 シニア DevOps への道【2026 年版】

Azure DevOps Engineer になるための認定取得ロードマップ完全版。AZ-900 → AZ-104 → AZ-400 の王道ルート、GitHub と Azure DevOps の両方を扱う AZ-400 の構成、Kubernetes 認定 (CKA / CKAD / CKS) との二刀流、IaC (Bicep / Terraform) 戦略、年収レンジまで日本語で網羅。

Technical information in this article is based on the Azure Virtual Machine Scale Sets Documentation. This article is not an official Microsoft Corporation product and has no affiliation or endorsement. Microsoft and Azure are trademarks of the Microsoft group of companies. Information reflects officially published material as of May 24, 2026. Always consult the official pages for the latest details.

Check what you learned with practice questions

Practice with certification-focused question sets

View Azure exam prep
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Azure

AZ-900 Azure Fundamentals: Complete Exam Guide (2026)

Pass AZ-900 — cloud concepts, Azure architecture, management...

Azure

Azure Certification Roadmap: Which Cert to Take Next (2026)

Choose your Azure certification path — Fundamentals, Associa...

Azure

AI-901 Azure AI Fundamentals (Beta): Complete Guide (2026)

Pass AI-901 — Microsoft Foundry, generative AI, responsible ...

Azure

Microsoft Entra ID Fundamentals for Azure Certs (2026)

Entra ID basics every cert candidate needs — tenants, identi...

Azure

DP-900 Azure Data Fundamentals: Complete Guide (2026)

Pass DP-900 — relational, non-relational, analytics, Power B...

Browse all Azure articles (104)
© 2026 NicheeLab All rights reserved.