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-instance-protection.md
+27-7Lines changed: 27 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,22 @@
1
1
---
2
2
title: Instance Protection for Azure virtual machine scale set instances
3
3
description: Learn how to protect Azure virtual machine scale set instances from scale-in and scale-set operations.
4
-
author: mayanknayar
4
+
author: avirishuv
5
5
tags: azure-resource-manager
6
6
ms.service: virtual-machine-scale-sets
7
7
ms.topic: conceptual
8
-
ms.date: 05/22/2019
9
-
ms.author: manayar
8
+
ms.date: 02/26/2020
9
+
ms.author: avverma
10
10
11
11
---
12
-
# Instance Protection for Azure virtual machine scale set instances (Preview)
12
+
# Instance Protection for Azure virtual machine scale set instances
13
+
13
14
Azure virtual machine scale sets enable better elasticity for your workloads through [Autoscale](virtual-machine-scale-sets-autoscale-overview.md), so you can configure when your infrastructure scales-out and when it scales-in. Scale sets also enable you to centrally manage, configure, and update a large number of VMs through different [upgrade policy](virtual-machine-scale-sets-upgrade-scale-set.md#how-to-bring-vms-up-to-date-with-the-latest-scale-set-model) settings. You can configure an update on the scale set model and the new configuration is applied automatically to every scale set instance if you've set the upgrade policy to Automatic or Rolling.
14
15
15
16
As your application processes traffic, there can be situations where you want specific instances to be treated differently from the rest of the scale set instance. For example, certain instances in the scale set could be performing long-running operations, and you don't want these instances to be scaled-in until the operations complete. You might also have specialized a few instances in the scale set to perform additional or different tasks than the other members of the scale set. You require these 'special' VMs not to be modified with the other instances in the scale set. Instance protection provides the additional controls to enable these and other scenarios for your application.
16
17
17
18
This article describes how you can apply and use the different instance protection capabilities with scale set instances.
18
19
19
-
> [!NOTE]
20
-
>Instance protection is currently in Public Preview. No opt-in procedure is needed to use the public preview functionality described below. Instance protection preview is only supported with API version 2019-03-01 and on scale sets using managed disks.
21
-
22
20
## Types of instance protection
23
21
Scale sets provide two types of instance protection capabilities:
24
22
@@ -40,6 +38,17 @@ Instance protection can be applied to scale set instances after the instances ar
40
38
41
39
There are multiple ways of applying scale-in protection on your scale set instances as detailed in the examples below.
42
40
41
+
### Azure portal
42
+
43
+
You can apply scale-in protection through the Azure portal to an instance in the scale set. You cannot adjust more than one instance at a time. Repeat the steps for each instance you want to protect.
44
+
45
+
1. Go to an existing virtual machine scale set.
46
+
1. Select **Instances** from the menu on the left, under **Settings**.
47
+
1. Select the name of the instance you want to protect.
48
+
1. Select the **Protection Policy** tab.
49
+
1. In the **Protection Policy** blade, select the **Protect from scale-in** option.
50
+
1. Select **Save**.
51
+
43
52
### REST API
44
53
45
54
The following example applies scale-in protection to an instance in the scale set.
@@ -97,6 +106,17 @@ Protecting an instance from scale set actions also protects the instance from Au
97
106
98
107
There are multiple ways of applying scale set actions protection on your scale set instances as detailed in the examples below.
99
108
109
+
### Azure portal
110
+
111
+
You can apply protection from scale set actions through the Azure portal to an instance in the scale set. You cannot adjust more than one instance at a time. Repeat the steps for each instance you want to protect.
112
+
113
+
1. Go to an existing virtual machine scale set.
114
+
1. Select **Instances** from the menu on the left, under **Settings**.
115
+
1. Select the name of the instance you want to protect.
116
+
1. Select the **Protection Policy** tab.
117
+
1. In the **Protection Policy** blade, select the **Protect from scale set actions** option.
118
+
1. Select **Save**.
119
+
100
120
### REST API
101
121
102
122
The following example applies protection from scale set actions to an instance in the scale set.
Copy file name to clipboardExpand all lines: articles/virtual-machine-scale-sets/virtual-machine-scale-sets-scale-in-policy.md
+78-10Lines changed: 78 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
1
---
2
2
title: Use custom scale-in policies with Azure virtual machine scale sets
3
3
description: Learn how to use custom scale-in policies with Azure virtual machine scale sets that use autoscale configuration to manage instance count
4
-
author: avverma
4
+
services: virtual-machine-scale-sets
5
+
author: avirishuv
6
+
manager: vashan
5
7
tags: azure-resource-manager
6
8
7
9
ms.service: virtual-machine-scale-sets
8
10
ms.workload: infrastructure-services
9
11
ms.tgt_pltfrm: vm
10
12
ms.topic: conceptual
11
-
ms.date: 10/11/2019
13
+
ms.date: 02/26/2020
12
14
ms.author: avverma
13
15
14
16
---
15
17
16
-
# Preview: Use custom scale-in policies with Azure virtual machine scale sets
18
+
# Use custom scale-in policies with Azure virtual machine scale sets
17
19
18
-
A virtual machine scale set deployment can be scaled-out or scaled-in based on an array of metrics, including platform and user-defined custom metrics. While a scale-out creates new Virtual Machines based on the scale set model, a scale-in affects running virtual machines that may have different configurations and/or functions as the scale set workload evolves.
20
+
A virtual machine scale set deployment can be scaled-out or scaled-in based on an array of metrics, including platform and user-defined custom metrics. While a scale-out creates new virtual machines based on the scale set model, a scale-in affects running virtual machines that may have different configurations and/or functions as the scale set workload evolves.
19
21
20
-
The scale-in policy feature provides users a way to configure the order in which virtual machines are scaled-in. The Preview introduces three scale-in configurations:
22
+
The scale-in policy feature provides users a way to configure the order in which virtual machines are scaled-in, by way of three scale-in configurations:
21
23
22
24
1. Default
23
25
2. NewestVM
24
26
3. OldestVM
25
27
26
-
***This preview feature is provided without a service level agreement, and it's not recommended for production workloads.***
27
-
28
28
### Default scale-in policy
29
29
30
30
By default, virtual machine scale set applies this policy to determine which instance(s) will be scaled in. With the *Default* policy, VMs are selected for scale-in in the following order:
@@ -35,7 +35,7 @@ By default, virtual machine scale set applies this policy to determine which ins
35
35
36
36
Users do not need to specify a scale-in policy if they just want the default ordering to be followed.
37
37
38
-
Note that balancing across availability zones or fault domains does not move instances across availability zones or fault domains. The balancing is achieved through deletion of virtual machines from the unbalanced availability zones or fault domains till the distribution of virtual machines becomes balanced.
38
+
Note that balancing across availability zones or fault domains does not move instances across availability zones or fault domains. The balancing is achieved through deletion of virtual machines from the unbalanced availability zones or fault domains until the distribution of virtual machines becomes balanced.
39
39
40
40
### NewestVM scale-in policy
41
41
@@ -51,6 +51,17 @@ A scale-in policy is defined in the virtual machine scale set model. As noted in
51
51
52
52
A scale-in policy can be defined on the virtual machine scale set model in the following ways:
53
53
54
+
### Azure portal
55
+
56
+
The following steps define the scale-in policy when creating a new scale set.
57
+
58
+
1. Go to **Virtual machine scale sets**.
59
+
1. Select **+ Add** to create a new scale set.
60
+
1. Go to the **Scaling** tab.
61
+
1. Locate the **Scale-in policy** section.
62
+
1. Select a scale-in policy from the drop-down.
63
+
1. When you are done creating the new scale set, select **Review + create** button.
64
+
54
65
### Using API
55
66
56
67
Execute a PUT on the virtual machine scale set using API 2019-03-01:
The following example adds a scale-in policy while creating a new scale set. First create a resource group, then create a new scale set with scale-in policy as *OldestVM*.
98
+
99
+
```azurecli-interactive
100
+
az group create --name <myResourceGroup> --location <VMSSLocation>
101
+
az vmss create \
102
+
--resource-group <myResourceGroup> \
103
+
--name <myVMScaleSet> \
104
+
--image UbuntuLTS \
105
+
--admin-username <azureuser> \
106
+
--generate-ssh-keys \
107
+
--scale-in-policy OldestVM
108
+
```
71
109
72
110
### Using Template
73
111
@@ -91,6 +129,15 @@ The same process applies when using ‘NewestVM’ in the above scale-in policy.
91
129
92
130
Modifying the scale-in policy follows the same process as applying the scale-in policy. For example, if in the above example, you want to change the policy from ‘OldestVM’ to ‘NewestVM’, you can do so by:
93
131
132
+
### Azure portal
133
+
134
+
You can modify the scale-in policy of an existing scale set through the Azure portal.
135
+
136
+
1. In an existing virtual machine scale set, select **Scaling** from the menu on the left.
137
+
1. Select the **Scale-In Policy** tab.
138
+
1. Select a scale-in policy from the drop-down.
139
+
1. When you are done, select **Save**.
140
+
94
141
### Using API
95
142
96
143
Execute a PUT on the virtual machine scale set using API 2019-03-01:
Update the scale-in policy of an existing scale set:
161
+
162
+
```azurepowershell-interactive
163
+
Update-AzVmss `
164
+
-ResourceGroupName "myResourceGroup" `
165
+
-VMScaleSetName "myScaleSet" `
166
+
-ScaleInPolicy “OldestVM”
167
+
```
168
+
169
+
### Azure CLI 2.0
170
+
171
+
The following is an example for updating the scale-in policy of an existing scale set:
172
+
173
+
```azurecli-interactive
174
+
az vmss update \
175
+
--resource-group <myResourceGroup> \
176
+
--name <myVMScaleSet> \
177
+
--scale-in-policy OldestVM
178
+
```
111
179
112
180
### Using Template
113
181
@@ -167,11 +235,11 @@ For non-zonal virtual machine scale sets, the policy selects the newest VM acros
167
235
## Troubleshoot
168
236
169
237
1. Failure to enable scaleInPolicy
170
-
If you get a ‘BadRequest’ error with an error message stating "Could not find member 'scaleInPolicy' on object of type 'properties'”, then check the API version used for virtual machine scale set. API version 2019-03-01 or higher is required for this preview.
238
+
If you get a ‘BadRequest’ error with an error message stating "Could not find member 'scaleInPolicy' on object of type 'properties'”, then check the API version used for virtual machine scale set. API version 2019-03-01 or higher is required for this feature.
171
239
172
240
2. Wrong selection of VMs for scale-in
173
241
Refer to the examples above. If your virtual machine scale set is a Zonal deployment, scale-in policy is applied first to the imbalanced Zones and then across the scale set once it is zone balanced. If the order of scale-in is not consistent with the examples above, raise a query with the virtual machine scale set team for troubleshooting.
174
242
175
243
## Next steps
176
244
177
-
Learn how to [deploy your application](virtual-machine-scale-sets-deploy-app.md) on virtual machine scale sets.
245
+
Learn how to [deploy your application](virtual-machine-scale-sets-deploy-app.md) on virtual machine scale sets.
0 commit comments