Coordinate repair without hiding the cause
Once Contoso has restored v1 on all four VMs, a quote service that stops responding on just one VM calls for a different decision. Is a restart enough, or does the VM need to be rebuilt? This unit explains what each repair preserves, which diagnostics to save first, and why Azure might defer an automatic repair.
During the bad rollout, Replace would have created another VM running v2-bad. With the approved model restored, choose the repair by what must survive:
| Action | What changes | When it fits |
|---|---|---|
| Restart | Retains VM identity, private IP, and managed disks; loses process memory. | A transient guest or process fault on a known-good release. |
| Reimage | Retains instance identity, private IP, and managed data disks; resets the OS disk. | The OS needs reconstruction and required configuration can be reapplied. |
| Replace | Creates a new instance from the current model. Old identity, addresses, disks, and guest-only edits aren't preserved. | A VM hosting a stateless quote service: pending requests and completed quotes are stored elsewhere. |
Never treat a temporary disk as durable, even for an action that normally preserves it. Save diagnostics before a destructive repair. Before an operator-targeted repair or removal, stop the quote service from acquiring new requests and confirm that in-flight work has completed durably or can be retried safely. If the service can't drain, its failure must still be covered by the queue's redelivery and duplicate-safe result handling.
Use the following procedure to distinguish a delayed repair from one that can't succeed:
- Confirm there's no active rollout, hold capacity steady, and verify the model and health endpoint. Compare failures across VMs. If several quote services fail together, check the shared queue and order system, name resolution, network access, and application authorization before treating the problem as a VM fault. Keep automatic repairs disabled, or suspend the enabled repair service, while evidence points to a shared dependency outage. Restore or escalate the dependency first, then re-evaluate each VM's health. Don't make the endpoint return healthy merely to bypass the failure.
- In Health and repair, check the configured action. To change an existing repair action, disable automatic repairs first, then re-enable them with the approved action and grace period. Resuming a suspended repair service isn't a substitute for correcting the cause.
- Find the completion time of the last qualifying instance state change. The 10-90 minute grace period starts then, not with each failed probe. With Contoso's ten-minute setting, if the quote service stops responding six minutes after the VM update completed, the VM is still inside its repair grace period. If the quote service fails 12 minutes after the VM update finishes, Contoso's 10-minute grace period has expired. If repair still doesn't start, check instance protection and whether automatic repairs are suspended.
- Under Instances > selected instance > Protection Policy, check for scale-in protection and scale-set-action protection. Either protection flag prevents automatic repairs on that VM. Neither flag prevents deletion of the entire scale set, and some manual VM operations are still possible. Confirm provisioning succeeded. Automatic repairs aren't a remedy for a VM that failed to initialize.
- Check repair service state, not just policy intent. In a scale set with fewer than 20 VMs, Azure repairs at most one VM at a time. For 20 or more VMs, the limit is 5% at a time. The rolling upgrade batch size doesn't change these repair limits. Repeated unhealthy replacements can suspend automatic repairs. If a 30-minute diagnostic window expires, investigate or escalate rather than repeatedly replacing VMs.
In PowerShell, confirm the Azure CLI subscription with az account show. Set $Rg to the intended resource group and $Name to the scale set. Read the repair service state to distinguish Running, Suspended, and Not Running:
az vmss get-instance-view --resource-group $Rg --name $Name --query orchestrationServices
If replacements keep failing, an authorized operator can suspend the enabled service while preserving evidence:
az vmss set-orchestration-service-state --resource-group $Rg --name $Name `
--service-name AutomaticRepairs --action Suspend
Use --action Resume only after correcting the cause and confirming the endpoint. After a Replace, correlate the repair operation with the old and new VM identities. On the new VM, confirm that the quote service runs v1, reports stable health, and returns the 49-tile quote. Record the repair count separately from any rollout or scaling action.