Skip to content

Commit 1b3928b

Browse files
author
Julia Shimanskiy
committed
added Ravi's updates and PS
1 parent ba77266 commit 1b3928b

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

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

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ Automatic repairs policy is supported for compute API version 2018-10-01 or high
4343

4444
**Restrictions on resource or subscription moves**
4545

46-
Resource or subscription moves are currently not supported for scale sets when automatic repairs policy is enabled.
46+
Resource or subscription moves are currently not supported for scale sets when automatic repairs feature is enabled.
4747

4848
**Restriction for service fabric scale sets**
4949

5050
This feature is currently not supported for service fabric scale sets.
5151

5252
## How do automatic instance repairs work?
5353

54-
Automatic instance repair feature relies on health monitoring of individual 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](./virtual-machine-scale-sets-health-extension.md) or [Load balancer health probes](../load-balancer/load-balancer-custom-probe-overview.md). If an instance is found to be unhealthy, then the scale set performs repair action by deleting the unhealthy instance and creating a new one to replace it. This feature can be enabled in the virtual machine scale set model by using the *automaticRepairsPolicy* object.
54+
Automatic instance repair feature relies on health monitoring of individual 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](./virtual-machine-scale-sets-health-extension.md) or [Load balancer health probes](../load-balancer/load-balancer-custom-probe-overview.md). If an instance is found to be unhealthy, then the scale set performs repair action by deleting the unhealthy instance and creating a new one to replace it. The latest virtual scale set model is used to create the new instance. This feature can be enabled in the virtual machine scale set model by using the *automaticRepairsPolicy* object.
5555

5656
### Batching
5757

@@ -63,7 +63,7 @@ When an instance goes through a state change operation because of a PUT, PATCH o
6363

6464
### Suspension of Repairs
6565

66-
Virtual machine scale sets provide the capability to temporarily suspend automatic instance repairs if needed. The *serviceState* for automatic repairs under the property *orchestrationServices* in instance view of virtual machine scale set can be used to suspend or resume the automatic repairs. When a scale set is opted into automatic repairs, the value of parameter *serviceState* is set to *Running*. When the automatic repairs are suspended for a scale set, the parameter *serviceState* is set to *Suspended*. If a scale set is not opted into the automatic repairs feature, then the parameter *serviceState* is set to *Not Running*.
66+
Virtual machine scale sets provide the capability to temporarily suspend automatic instance repairs if needed. The *serviceState* for automatic repairs under the property *orchestrationServices* in instance view of virtual machine scale set shows the current state of the automatic repairs. When a scale set is opted into automatic repairs, the value of parameter *serviceState* is set to *Running*. When the automatic repairs are suspended for a scale set, the parameter *serviceState* is set to *Suspended*. If *automaticRepairsPolicy* is defined on a scale set but the automatic repairs feature is not enabled, then the parameter *serviceState* is set to *Not Running*.
6767

6868
If newly created instances for replacing the unhealthy ones in a scale set continue to remain unhealthy even after repeatedly performing repair operations, then as a safety measure the platform updates the *serviceState* for automatic repairs to *Suspended*. You can resume the automatic repairs again by setting the value of *serviceState* for automatic repairs to *Running*. Detailed instructions are provided in the section on [viewing and updating the service state of automatic repairs policy](#viewing-and-updating-the-service-state-of-automatic-instance-repairs-policy) for your scale set.
6969

@@ -81,7 +81,7 @@ If an instance in a scale set is protected by applying one of the [protection po
8181

8282
## Terminate notification and automatic repairs
8383

84-
If the [terminate notification](./virtual-machine-scale-sets-terminate-notification.md) feature is enabled on a scale set, then during automatic repair operation, the deletion of an unhealthy instance follows the properties configured under this feature. A terminate notification is sent through Azure metadata service – scheduled events – and instance deletion is delayed for the duration of the configured delay timeout. However, the creation of a new instance to replace the unhealthy one does not wait for the delay timeout to complete.
84+
If the [terminate notification](./virtual-machine-scale-sets-terminate-notification.md) feature is enabled on a scale set, then during automatic repair operation, the deletion of an unhealthy instance follows the terminate notification configuration. A terminate notification is sent through Azure metadata service – scheduled events – and instance deletion is delayed for the duration of the configured delay timeout. However, the creation of a new instance to replace the unhealthy one does not wait for the delay timeout to complete.
8585

8686
## Enabling automatic repairs policy when creating a new scale set
8787

@@ -235,7 +235,7 @@ GET '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider
235235
}
236236
```
237237

238-
Use Set Orchestration Service State with API version 2019-12-01 or higher for virtual machine scale set to set the *serviceState* for automatic repairs under the property *orchestrationServices* in the scale set instance view. Once the scale set is opted into the automatic repairs feature, you can use this API to suspend or resume automatic repairs for your scale set.
238+
Use *setOrchestrationServiceState* API with API version 2019-12-01 or higher on a virtual machine scale set to set the state of automatic repairs. Once the scale set is opted into the automatic repairs feature, you can use this API to suspend or resume automatic repairs for your scale set.
239239

240240
```http
241241
POST '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState?api-version=2019-12-01'
@@ -271,6 +271,26 @@ az vmss set-orchestration-service-state \
271271
--name MyScaleSet \
272272
--resource-group MyResourceGroup
273273
```
274+
### Azure PowerShell
275+
276+
Use [Get-AzVmss](https://docs.microsoft.com/powershell/module/az.compute/get-azvmss?view=azps-3.7.0) cmdlet with parameter *InstanceView* to view the *ServiceState* for automatic instance repairs.
277+
278+
```azurepowershell-interactive
279+
Get-AzVmss `
280+
-ResourceGroupName "myResourceGroup" `
281+
-VMScaleSetName "myScaleSet" `
282+
-InstanceView
283+
```
284+
285+
Use Set-AzVmssOrchestrationServiceState cmdlet to update the *serviceState* for automatic instance repairs. Once the scale set is opted into the automatic repair feature, you can use this cmdlet to suspend or resume automatic repairs for you scale set.
286+
287+
```azurepowershell-interactive
288+
Set-AzVmssOrchestrationServiceState `
289+
-ResourceGroupName "myResourceGroup" `
290+
-VMScaleSetName "myScaleSet" `
291+
-ServiceName "AutomaticRepairs" `
292+
-Action "Suspend"
293+
```
274294

275295
## Troubleshoot
276296

0 commit comments

Comments
 (0)