Skip to content

Commit 62e46c6

Browse files
authored
Updated AFEC instructions
1 parent ca2d4f6 commit 62e46c6

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

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

Lines changed: 23 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,30 @@ 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+
275290
## Configure a repair action on automatic repairs policy
276291

277292
> [!CAUTION]
278293
> 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).
280295
281296
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.
282297

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

285300
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.
286301

@@ -315,7 +330,7 @@ PUT or PATCH on '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa
315330
}
316331
```
317332

318-
### [Azure CLI](#tab/cli-3)
333+
### [Azure CLI](#tab/cli-4)
319334

320335
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)*.
321336

@@ -337,7 +352,7 @@ az vmss update \
337352
--automatic-repairs-action Replace
338353
```
339354

340-
### [Azure PowerShell](#tab/powershell-3)
355+
### [Azure PowerShell](#tab/powershell-4)
341356

342357
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.
343358

@@ -362,7 +377,7 @@ Update-AzVmss `
362377

363378
## Viewing and updating the service state of automatic instance repairs policy
364379

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

367382
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*.
368383

@@ -392,7 +407,7 @@ POST '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provide
392407
}
393408
```
394409

395-
### [Azure CLI](#tab/cli-4)
410+
### [Azure CLI](#tab/cli-5)
396411

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

@@ -411,7 +426,7 @@ az vmss set-orchestration-service-state \
411426
--name MyScaleSet \
412427
--resource-group MyResourceGroup
413428
```
414-
### [Azure PowerShell](#tab/powershell-4)
429+
### [Azure PowerShell](#tab/powershell-5)
415430

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

0 commit comments

Comments
 (0)