Automatic instance repairs#
Reliability · Virtual Machine Scale Sets · Rule · Preview · 2024_06 · Important
Automatic instance repairs are enabled.
Description#
Enabling automatic instance repairs helps to achieve high application availability by automatically detecting and recovering unhealthy VM instances at runtime.
The automatic instance repair feature relies on health monitoring of individual VM instances in a scale set.
VM Instances in a scale set can be configured to emit application health status using either the Application Health extension or Load balancer health probes.
If an VM instance is found to be unhealthy, the scale set will perform a preconfigured repair action on the unhealthy VM instance.
Automatic instance repairs can be enabled in the Virtual Machine Scale Set model by using the automaticRepairsPolicy
object.
See documentation references below for additional limitations and important information.
Recommendation#
Consider enabling automatic instance repairs to achieve high application availability by maintaining a set of healthy VM instances.
Examples#
Configure with Azure template#
To deploy virtual machine scale sets that pass this rule:
- Set the
properties.automaticRepairsPolicy.enabled
property totrue
.
For example:
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "2023-09-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"sku": {
"name": "b2ms",
"tier": "Standard",
"capacity": 1
},
"properties": {
"automaticRepairsPolicy": {
"enabled": true
}
}
}
Configure with Bicep#
To deploy virtual machine scale sets that pass this rule:
- Set the
properties.automaticRepairsPolicy.enabled
property totrue
.
For example:
resource vmss 'Microsoft.Compute/virtualMachineScaleSets@2023-09-01' = {
name: name
location: location
sku: {
name: 'b2ms'
tier: 'Standard'
capacity: 1
}
properties: {
automaticRepairsPolicy: {
enabled: true
}
}
}
Notes#
This feature for virtual machine scale sets is currently in preview.
In order for automatic repairs policy to work properly, ensure that all the requirements for opting in to this feature are met.