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
+23-8Lines changed: 23 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,30 @@ 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
291
277
292
> [!CAUTION]
278
293
> 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).
294
+
> For more information, see [feature registration](#feature-registration).
280
295
281
296
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
297
283
-
### [REST API](#tab/rest-api-3)
298
+
### [REST API](#tab/rest-api-4)
284
299
285
300
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
301
@@ -315,7 +330,7 @@ PUT or PATCH on '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa
315
330
}
316
331
```
317
332
318
-
### [Azure CLI](#tab/cli-3)
333
+
### [Azure CLI](#tab/cli-4)
319
334
320
335
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
336
@@ -337,7 +352,7 @@ az vmss update \
337
352
--automatic-repairs-action Replace
338
353
```
339
354
340
-
### [Azure PowerShell](#tab/powershell-3)
355
+
### [Azure PowerShell](#tab/powershell-4)
341
356
342
357
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
358
@@ -362,7 +377,7 @@ Update-AzVmss `
362
377
363
378
## Viewing and updating the service state of automatic instance repairs policy
364
379
365
-
### [REST API](#tab/rest-api-4)
380
+
### [REST API](#tab/rest-api-5)
366
381
367
382
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
383
@@ -392,7 +407,7 @@ POST '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provide
392
407
}
393
408
```
394
409
395
-
### [Azure CLI](#tab/cli-4)
410
+
### [Azure CLI](#tab/cli-5)
396
411
397
412
Use [get-instance-view](/cli/azure/vmss#az-vmss-get-instance-view) cmdlet to view the *serviceState* for automatic instance repairs.
398
413
@@ -411,7 +426,7 @@ az vmss set-orchestration-service-state \
411
426
--name MyScaleSet \
412
427
--resource-group MyResourceGroup
413
428
```
414
-
### [Azure PowerShell](#tab/powershell-4)
429
+
### [Azure PowerShell](#tab/powershell-5)
415
430
416
431
Use [Get-AzVmss](/powershell/module/az.compute/get-azvmss) cmdlet with parameter *InstanceView* to view the *ServiceState* for automatic instance repairs.
0 commit comments