Skip to content

Commit 59db044

Browse files
Merge pull request #278972 from hilaryw29/patch-26
Updated AFEC instructions
2 parents 49d1576 + 9b8074c commit 59db044

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

articles/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-instance-repairs.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The automatic instance repairs process goes as follows:
6666

6767
> [!CAUTION]
6868
> 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).
7070
7171
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.
7272

@@ -272,15 +272,32 @@ az vmss update \
272272

273273
---
274274

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
283+
```
284+
### [Azure PowerShell](#tab/powershell-3)
285+
286+
```azurepowershell-interactive
287+
Register-AzProviderFeature -FeatureName "AutomaticRepairsWithConfigurableRepairActions" -ProviderNamespace "Microsoft.Compute"
288+
```
289+
290+
---
291+
275292
## Configure a repair action on automatic repairs policy
276293

277294
> [!CAUTION]
278295
> 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).
280297
281298
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.
282299

283-
### [REST API](#tab/rest-api-3)
300+
### [REST API](#tab/rest-api-4)
284301

285302
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.
286303

@@ -315,7 +332,7 @@ PUT or PATCH on '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa
315332
}
316333
```
317334

318-
### [Azure CLI](#tab/cli-3)
335+
### [Azure CLI](#tab/cli-4)
319336

320337
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)*.
321338

@@ -337,7 +354,7 @@ az vmss update \
337354
--automatic-repairs-action Replace
338355
```
339356

340-
### [Azure PowerShell](#tab/powershell-3)
357+
### [Azure PowerShell](#tab/powershell-4)
341358

342359
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.
343360

@@ -362,7 +379,7 @@ Update-AzVmss `
362379

363380
## Viewing and updating the service state of automatic instance repairs policy
364381

365-
### [REST API](#tab/rest-api-4)
382+
### [REST API](#tab/rest-api-5)
366383

367384
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*.
368385

@@ -392,7 +409,7 @@ POST '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provide
392409
}
393410
```
394411

395-
### [Azure CLI](#tab/cli-4)
412+
### [Azure CLI](#tab/cli-5)
396413

397414
Use [get-instance-view](/cli/azure/vmss#az-vmss-get-instance-view) cmdlet to view the *serviceState* for automatic instance repairs.
398415

@@ -411,7 +428,7 @@ az vmss set-orchestration-service-state \
411428
--name MyScaleSet \
412429
--resource-group MyResourceGroup
413430
```
414-
### [Azure PowerShell](#tab/powershell-4)
431+
### [Azure PowerShell](#tab/powershell-5)
415432

416433
Use [Get-AzVmss](/powershell/module/az.compute/get-azvmss) cmdlet with parameter *InstanceView* to view the *ServiceState* for automatic instance repairs.
417434

0 commit comments

Comments
 (0)