Skip to content

Commit 34b8f20

Browse files
authored
Merge pull request #228424 from ju-shim/spot-mix-ga
Spot Priority Mix - GA
2 parents 8775f3a + 862fbca commit 34b8f20

File tree

2 files changed

+89
-25
lines changed

2 files changed

+89
-25
lines changed

articles/virtual-machine-scale-sets/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
items:
107107
- name: Azure Spot Virtual Machines
108108
href: use-spot.md
109-
- name: Spot Priority Mix (preview)
109+
- name: Spot Priority Mix
110110
href: spot-priority-mix.md
111111
- name: Reserved instances
112112
href: ../cost-management-billing/reservations/save-compute-costs-reservations.md

articles/virtual-machine-scale-sets/spot-priority-mix.md

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
---
22
title: Get high availability and cost savings with Spot Priority Mix for Virtual Machine Scale Sets
3-
description: Learn how to run a mix of Spot VMs and uninterruptible regular VMs for Virtual Machine Scale Sets to achieve high availability and cost savings.
3+
description: Learn how to run a mix of Spot VMs and uninterruptible standard VMs for Virtual Machine Scale Sets to achieve high availability and cost savings.
44
author: ju-shim
55
ms.author: jushiman
66
ms.service: virtual-machine-scale-sets
77
ms.subservice: spot
88
ms.workload: infrastructure-services
99
ms.topic: conceptual
10-
ms.date: 11/22/2022
10+
ms.date: 03/09/2023
1111
ms.reviewer: cynthn
1212
ms.custom: engagement-fy23
1313
---
1414

15-
# Spot Priority Mix for high availability and cost savings (preview)
15+
# Spot Priority Mix for high availability and cost savings
1616

1717
**Applies to:** :heavy_check_mark: Flexible scale sets
1818

19-
> [!IMPORTANT]
20-
> **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-
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:
19+
Azure allows you to have the flexibility of running a mix of uninterruptible standard 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 goals:
2520

2621
- Reduce compute infrastructure costs by applying the deep discounts of Spot VMs
27-
- Maintain capacity availability through uninterruptible regular VMs in the scale set deployment
22+
- Maintain capacity availability through uninterruptible standard VMs in the scale set deployment
2823
- 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-
- 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
24+
- Simplify the scale-out and scale-in of compute workloads that require both Spot and standard VMs by letting Azure orchestrate the creation and deletion of VMs
25+
26+
## Configure your mix
3027

31-
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.
28+
You can configure a custom percentage distribution across Spot and standard 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 standard VMs you would like to maintain in the Virtual Machine Scale Set during any scale operation.
3229

33-
## [Template](#tab/template-1)
30+
### [Template](#tab/template-1)
3431

3532
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:
3633

@@ -42,28 +39,25 @@ You can set your Spot Priority Mix by using a template to add the following prop
4239
```
4340

4441
**Parameters:**
45-
- `baseRegularPriorityCount` – Specifies a base number of VMs that will be *Regular* priority; if the Scale Set capacity is at or below this number, all VMs will be *Regular* priority.
46-
- `regularPriorityPercentageAboveBase` – Specifies the percentage split of *Regular* and *Spot* priority VMs that will be used when the Scale Set capacity is above the *baseRegularPriorityCount*.
42+
- `baseRegularPriorityCount` – Specifies a base number of VMs that are standard, *Regular* priority; if the Scale Set capacity is at or below this number, all VMs are *Regular* priority.
43+
- `regularPriorityPercentageAboveBase` – Specifies the percentage split of *Regular* and *Spot* priority VMs that are used when the Scale Set capacity is above the *baseRegularPriorityCount*.
4744

4845
You can refer to this [ARM template example](https://paste.microsoft.com/f84d2f83-f6bf-4d24-aa03-175b0c43da32) for more context.
4946

50-
## [Portal](#tab/portal-1)
47+
### [Portal](#tab/portal-1)
5148

52-
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.
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 instruct you on how to access this feature during that process.
5350

5451
1. Log in to the [Azure portal](https://portal.azure.com).
5552
1. In the search bar, search for and select **Virtual Machine Scale Sets**.
5653
1. Select **Create** on the **Virtual Machine Scale Sets** page.
57-
1. In the **Basics** tab, fill out the required fields and select **Flexible** as the **Orchestration** mode.
54+
1. In the **Basics** tab, fill out the required fields, select **Flexible** as the **Orchestration** mode, and select the checkbox for **Run with Azure Spot discount**.
5855
1. Fill out the **Disks** and **Networking** tabs.
59-
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.
56+
1. In the **Spot** tab, select the check-box next to *Scale with VMs and Spot VMs* option under the **Scale with VMs and discounted Spot VMs** section.
6057
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-
6458
1. Continue through the Virtual Machine Scale Set creation process.
6559

66-
## [Azure CLI](#tab/cli-1)
60+
### [Azure CLI](#tab/cli-1)
6761

6862
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.
6963

@@ -81,7 +75,7 @@ az vmss create -n myScaleSet \
8175
--single-placement-group False \
8276
```
8377

84-
## [Azure PowerShell](#tab/powershell-1)
78+
### [Azure PowerShell](#tab/powershell-1)
8579

8680
You can set your Spot Priority Mix using Azure PowerShell by setting the `Priority` flag to `Spot` and including the `BaseRegularPriorityCount` and `RegularPriorityPercentage` flags.
8781

@@ -106,6 +100,76 @@ New-AzVmss `
106100

107101
---
108102

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 (standard) VMs** are the number of standard 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
115+
- **Base (standard) VMs:** 10
116+
- **Extra standard VMs:** 0
117+
- **Spot priority VMs:** 0
118+
- **regularPriorityPercentageAboveBase:** 50%
119+
- **Eviction policy:** Delete
120+
121+
| Action | sku.capacity | Base (standard) VMs | Extra standard VMs | Spot priority VMs |
122+
|---|---|---|---|---|
123+
| Create | 10 | 10 | 0 | 0 |
124+
| Scale out | 20 | 10 | 5 | 5 |
125+
| Scale out | 30 | 10 | 10 | 10 |
126+
| Scale out | 40 | 10 | 15 | 15 |
127+
| Scale out | 41 | 10 | 15 | 16 |
128+
| Scale out | 42 | 10 | 16 | 16 |
129+
| Evict-Delete (all Spot instances) | 26 | 10 | 16 | 0 |
130+
| Scale out | 30 | 10 | 16 | 4 |
131+
| Scale out | 42 | 10 | 16 | 16 |
132+
| Scale out | 44 | 10 | 17 | 17 |
133+
134+
Example walk-through:
135+
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 are set at 10, thus your total starting VMs are just 10 Base (standard) VMs.
137+
1. You then scale-out 5 times, with 50% standard VMs and 50% Spot VMs.
138+
- Note, because there's a 50/50 split, in the fourth scale-out, there's one more Spot VM than standard VM. Once it's scaled out again (5th scale-out), the 50/50 balance is restored with another standard VM.
139+
1. You then scale in your scale set with the eviction policy being delete, which deletes all the Spot VMs.
140+
1. With the scale-out operations mentioned in this scenario, you 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 is 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
147+
- **Base (standard) VMs:** 10
148+
- **Extra standard VMs:** 2
149+
- **Spot priority VMs:** 8
150+
- **regularPriorityPercentageAboveBase:** 25%
151+
- **Eviction policy:** Deallocate
152+
153+
| Action | sku.capacity | Base (standard) VMs | Extra standard VMs | Spot priority VMs |
154+
|---|---|---|---|---|
155+
| Create | 20 | 10 | 2 | 8 |
156+
| Scale out | 50 | 10 | 10 | 30 |
157+
| Scale out | 110 | 10 | 25 | 75 |
158+
| Evict-Delete (10 instances) | 100 | 10 | 25 | 75 (65 running VMs, 10 Stop-Deallocated VMs) |
159+
| Scale out | 120 | 10 | 27 | 83 (73 running VMs, 10 Stop-Deallocated VMs) |
160+
161+
Example walk-through:
162+
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 (standard) VMs, 2 extra standard VMs, and 8 Spot priority VMs for your 25% *regularPriorityPercentageAboveBase*.
164+
- Another way to look at this ratio is you have 1 standard VM for every 4 Spot VMs in the scale set.
165+
1. You then scale-out twice to create 90 more VMs; 23 standard 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 standard VMs and 8 Spot VMs, bringing you closer to your 25% above base ratio.
168+
169+
## Troubleshooting
170+
171+
If Spot Priority Mix is not available to you, be sure to configure the `priorityMixPolicy` to specify a *Spot* priority in the `virtualMachineProfile`. Without that configuration, you will not be able to access this Spot feature.
172+
109173
## Next steps
110174

111175
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)