You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-instance-repairs.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ The automatic instance repairs process goes as follows:
66
66
67
67
> [!CAUTION]
68
68
> The `repairAction` setting, is currently under PREVIEW and not suitable for production workloads. To preview the **Restart** and **Reimage** repair actions, you must register your Azure subscription with the AFEC flag `AutomaticRepairsWithConfigurableRepairActions` and your compute API version must be 2021-11-01 or higher.
69
-
> For more information, see [set up preview features in Azure subscription](../azure-resource-manager/management/preview-features.md).
69
+
> For more information, see [feature registration](#feature-registration).
70
70
71
71
There are three available repair actions for automatic instance repairs – Replace, Reimage (Preview), and Restart (Preview). The default repair action is Replace, but you can switch to Reimage (Preview) or Restart (Preview) by enrolling in the preview and modifying the `repairAction` setting under `automaticRepairsPolicy` object.
72
72
@@ -272,15 +272,32 @@ az vmss update \
272
272
273
273
---
274
274
275
+
## Feature Registration
276
+
277
+
Before configuring `repairAction` setting under `automaticRepairsPolicy`, register the feature providers to your subscription.
278
+
279
+
### [Azure CLI](#tab/cli-3)
280
+
281
+
```azurecli-interactive
282
+
az feature register --name AutomaticRepairsWithConfigurableRepairActions --namespace Microsoft.Compute
## Configure a repair action on automatic repairs policy
276
293
277
294
> [!CAUTION]
278
295
> The `repairAction` setting, is currently under PREVIEW and not suitable for production workloads. To preview the **Restart** and **Reimage** repair actions, you must register your Azure subscription with the AFEC flag `AutomaticRepairsWithConfigurableRepairActions` and your compute API version must be 2021-11-01 or higher.
279
-
> For more information, see [set up preview features in Azure subscription](../azure-resource-manager/management/preview-features.md).
296
+
> For more information, see [feature registration](#feature-registration).
280
297
281
298
The `repairAction` setting under `automaticRepairsPolicy` allows you to specify the desired repair action performed in response to an unhealthy instance. If you are updating the repair action on an existing automatic repairs policy, you must first disable automatic repairs on the scale set and re-enable with the updated repair action. This process is illustrated in the examples below.
282
299
283
-
### [REST API](#tab/rest-api-3)
300
+
### [REST API](#tab/rest-api-4)
284
301
285
302
This example demonstrates how to update the repair action on a scale set with an existing automatic repairs policy. Use API version 2021-11-01 or higher.
286
303
@@ -315,7 +332,7 @@ PUT or PATCH on '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa
315
332
}
316
333
```
317
334
318
-
### [Azure CLI](#tab/cli-3)
335
+
### [Azure CLI](#tab/cli-4)
319
336
320
337
This example demonstrates how to update the repair action on a scale set with an existing automatic repairs policy, using *[az vmss update](/cli/azure/vmss#az-vmss-update)*.
321
338
@@ -337,7 +354,7 @@ az vmss update \
337
354
--automatic-repairs-action Replace
338
355
```
339
356
340
-
### [Azure PowerShell](#tab/powershell-3)
357
+
### [Azure PowerShell](#tab/powershell-4)
341
358
342
359
This example demonstrates how to update the repair action on a scale set with an existing automatic repairs policy, using [Update-AzVmss](/powershell/module/az.compute/update-azvmss). Use PowerShell Version 7.3.6 or higher.
343
360
@@ -362,7 +379,7 @@ Update-AzVmss `
362
379
363
380
## Viewing and updating the service state of automatic instance repairs policy
364
381
365
-
### [REST API](#tab/rest-api-4)
382
+
### [REST API](#tab/rest-api-5)
366
383
367
384
Use [Get Instance View](/rest/api/compute/virtualmachinescalesets/getinstanceview) with API version 2019-12-01 or higher for Virtual Machine Scale Set to view the *serviceState* for automatic repairs under the property *orchestrationServices*.
368
385
@@ -392,7 +409,7 @@ POST '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provide
392
409
}
393
410
```
394
411
395
-
### [Azure CLI](#tab/cli-4)
412
+
### [Azure CLI](#tab/cli-5)
396
413
397
414
Use [get-instance-view](/cli/azure/vmss#az-vmss-get-instance-view) cmdlet to view the *serviceState* for automatic instance repairs.
398
415
@@ -411,7 +428,7 @@ az vmss set-orchestration-service-state \
411
428
--name MyScaleSet \
412
429
--resource-group MyResourceGroup
413
430
```
414
-
### [Azure PowerShell](#tab/powershell-4)
431
+
### [Azure PowerShell](#tab/powershell-5)
415
432
416
433
Use [Get-AzVmss](/powershell/module/az.compute/get-azvmss) cmdlet with parameter *InstanceView* to view the *ServiceState* for automatic instance repairs.
0 commit comments