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
> **Spot Priority Mix** is currently in public preview.
21
-
> This preview version is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities.
22
-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
23
-
24
19
Azure allows you to have the flexibility of running a mix of uninterruptible regular VMs and interruptible Spot VMs for Virtual Machine Scale Set deployments. You're able to deploy this Spot Priority Mix using Flexible orchestration to easily balance between high-capacity availability and lower infrastructure costs according to your workload requirements. This feature allows you to easily manage your scale set capability to achieve the following:
25
20
26
21
- Reduce compute infrastructure costs by applying the deep discounts of Spot VMs
27
22
- Maintain capacity availability through uninterruptible regular VMs in the scale set deployment
28
23
- Provide reassurance that all your VMs won't be taken away simultaneously due to evictions before the infrastructure has time to react and recover the evicted capacity
29
24
- Simplify the scale-out and scale-in of compute workloads that require both Spot and regular VMs by letting Azure orchestrate the creation and deletion of VMs
30
25
26
+
## Configure your mix
27
+
31
28
You can configure a custom percentage distribution across Spot and regular VMs. The platform automatically orchestrates each scale-out and scale-in operation to achieve the desired distribution by selecting an appropriate number of VMs to create or delete. You can also optionally configure the number of base regular uninterruptible VMs you would like to maintain in the Virtual Machine Scale Set during any scale operation.
32
29
33
-
## [Template](#tab/template-1)
30
+
###[Template](#tab/template-1)
34
31
35
32
You can set your Spot Priority Mix by using a template to add the following properties to a scale set with Flexible orchestration using a Spot priority VM profile:
36
33
@@ -47,7 +44,7 @@ You can set your Spot Priority Mix by using a template to add the following prop
47
44
48
45
You can refer to this [ARM template example](https://paste.microsoft.com/f84d2f83-f6bf-4d24-aa03-175b0c43da32) for more context.
49
46
50
-
## [Portal](#tab/portal-1)
47
+
###[Portal](#tab/portal-1)
51
48
52
49
You can set your Spot Priority Mix in the Scaling tab of the Virtual Machine Scale Sets creation process in the Azure portal. The following steps will instruct you on how to access this feature during that process.
53
50
@@ -58,12 +55,9 @@ You can set your Spot Priority Mix in the Scaling tab of the Virtual Machine Sca
58
55
1. Fill out the **Disks** and **Networking** tabs.
59
56
1. In the **Scaling** tab, select the check-box next to *Scale with VMs and Spot VMs* option under the **Scale with VMs and discounted Spot VMs** section.
60
57
1. Fill out the **Base VM (uninterruptible) count** and **Instance distribution** fields to configure your priorities.
61
-
62
-
:::image type="content" source="./media/spot-priority-mix/scale-with-vms-and-discounted-spot-vms.png" alt-text="Screenshot of the Scale with VMs and discounted Spot VMs section in the Scaling tab within Azure portal.":::
63
-
64
58
1. Continue through the Virtual Machine Scale Set creation process.
65
59
66
-
## [Azure CLI](#tab/cli-1)
60
+
###[Azure CLI](#tab/cli-1)
67
61
68
62
You can set your Spot Priority Mix using Azure CLI by setting the `priority` flag to `Spot` and including the `regular-priority-count` and `regular-priority-percentage` flags.
69
63
@@ -81,7 +75,7 @@ az vmss create -n myScaleSet \
81
75
--single-placement-group False \
82
76
```
83
77
84
-
## [Azure PowerShell](#tab/powershell-1)
78
+
###[Azure PowerShell](#tab/powershell-1)
85
79
86
80
You can set your Spot Priority Mix using Azure PowerShell by setting the `Priority` flag to `Spot` and including the `BaseRegularPriorityCount` and `RegularPriorityPercentage` flags.
87
81
@@ -106,6 +100,76 @@ New-AzVmss `
106
100
107
101
---
108
102
103
+
## Examples
104
+
105
+
The following examples have scenario assumptions, a table of actions, and walk-through of results to help you understand how Spot Priority Mix configuration works.
106
+
107
+
Some important terminology to notice before referring to these examples:
108
+
-**sku.capacity** is the total number of VMs in the Virtual Machine Scale Set
109
+
-**Base (Regular priority) VMs** are the number of Regular priority non-Spot VMs, akin to a minimum VM number
110
+
111
+
### Scenario 1
112
+
113
+
The following scenario assumptions apply to this example:
114
+
-**sku.capacity** is variable, as the autoscaler will add or remove VMs from the scale set
1. You start out with a Virtual Machine Scale Set with 10 VMs.
136
+
- The `sku.capacity` is variable and doesn't set a starting number of VMs. The Base VMs is set at 10, thus your total starting VMs is just 10 Base (Regular priority) VMs.
137
+
1. You then scale out 5 times, with 50% Regular priority VMs and 50% Spot VMs.
138
+
- Note, because there's a 50/50 split, in the fourth scale out, there is one more Spot VM than Regular priority. Once it's scaled out again (5th scale out), the 50/50 balance is restored with another Regular priority VM.
139
+
1. You then scale in your scale set with the eviction policy being delete. This will delete all the Spot VMs.
140
+
1. With the scale out operations mention in this scenario, you will restore the 50/50 balance in your scale set by only creating Spot VMs.
141
+
1. By the last scale out, your scale set is already balanced, so one of each type of VM will be created.
142
+
143
+
### Scenario 2
144
+
145
+
The following scenario assumptions apply to this example:
146
+
-**sku.capacity** is variable, defined by autoscaler; starting with 20
1. With the initial creation of the Virtual Machine Scale Set and Spot Priority Mix, you have 20 VMs.
163
+
- 10 of those VMs are the Base (Regular priority) VMs, 2 Additional Regular priority VMs, and 8 Spot priority VMs for your 25% *regularPriorityPercentageAboveBase*.
164
+
- Another way to look at this is you have 1 Regular priority VM for every 4 Spot VMs in the scale set.
165
+
1. You then scale out twice to create 90 more VMs; 23 Regular priority VMs and 67 Spot VMs.
166
+
1. When you scale in by 10 VMs, 10 Spot VMs are *stop-deallocated*, creating an imbalance in your scale set.
167
+
1. Your next scale out operation creates another 2 Regular priority VMs and 8 Spot VMs, bringing you closer to your 25% above base ratio.
168
+
169
+
## Troubleshooting
170
+
171
+
There is only one error that is specific to Spot Priority Mix. To avoid it, be sure to configure the `priorityMixPolicy` to specify a *Spot* priority in `the virtualMachineProfile`. All other potential errors are either the normal Virtual Machine Scale Set, Spot, or Autoscale errors.
0 commit comments