Skip to content

Commit 445c805

Browse files
authored
Merge pull request #175533 from mimckitt/release-spot-try-restore-ga
Azure Spot Try & restore GA 10/25
2 parents 569712b + 7bfa092 commit 445c805

File tree

4 files changed

+43
-71
lines changed

4 files changed

+43
-71
lines changed
69.8 KB
Loading

articles/virtual-machine-scale-sets/use-spot.md

Lines changed: 40 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Create a scale set that uses Azure Spot Virtual Machines
33
description: Learn how to create Azure virtual machine scale sets that use Azure Spot Virtual Machines to save on costs.
4-
author: JagVeerappan
5-
ms.author: jagaveer
4+
author: mimckitt
5+
ms.author: mimckitt
66
ms.topic: how-to
77
ms.service: virtual-machine-scale-sets
88
ms.subservice: spot
9-
ms.date: 02/26/2021
9+
ms.date: 10/22/2021
1010
ms.reviewer: cynthn
1111
ms.custom: devx-track-azurecli, devx-track-azurepowershell
1212

@@ -20,15 +20,6 @@ Using Azure Spot Virtual Machines on scale sets allows you to take advantage of
2020

2121
The amount of available capacity can vary based on size, region, time of day, and more. When deploying Azure Spot Virtual Machine instances on scale sets, Azure will allocate the instance only if there is capacity available, but there is no SLA for these instances. An Azure Spot Virtual machine scale set is deployed in a single fault domain and offers no high availability guarantees.
2222

23-
24-
## Pricing
25-
26-
Pricing for Azure Spot Virtual Machine instances is variable, based on region and SKU. For more information, see pricing for [Linux](https://azure.microsoft.com/pricing/details/virtual-machine-scale-sets/linux/) and [Windows](https://azure.microsoft.com/pricing/details/virtual-machine-scale-sets/windows/).
27-
28-
29-
With variable pricing, you have option to set a max price, in US dollars (USD), using up to five decimal places. For example, the value `0.98765`would be a max price of $0.98765 USD per hour. If you set the max price to be `-1`, the instance won't be evicted based on price. The price for the instance will be the current price for Azure Spot Virtual Machine or the price for a standard instance, which ever is less, as long as there is capacity and quota available.
30-
31-
3223
## Limitations
3324

3425
The following sizes are not supported for Azure Spot Virtual Machines:
@@ -37,15 +28,22 @@ The following sizes are not supported for Azure Spot Virtual Machines:
3728

3829
Azure Spot Virtual Machine can be deployed to any region, except Microsoft Azure China 21Vianet.
3930

40-
<a name="channel"></a>
41-
4231
The following [offer types](https://azure.microsoft.com/support/legal/offer-details/) are currently supported:
4332

4433
- Enterprise Agreement
4534
- Pay-as-you-go offer code (003P)
4635
- Sponsored (0036P and 0136P)
4736
- For Cloud Service Provider (CSP), see the [Partner Center](/partner-center/azure-plan-get-started) or contact your partner directly.
4837

38+
## Pricing
39+
40+
Pricing for Azure Spot Virtual Machine instances is variable, based on region and SKU. For more information, see pricing for [Linux](https://azure.microsoft.com/pricing/details/virtual-machine-scale-sets/linux/) and [Windows](https://azure.microsoft.com/pricing/details/virtual-machine-scale-sets/windows/).
41+
42+
43+
With variable pricing, you have option to set a max price, in US dollars (USD), using up to five decimal places. For example, the value `0.98765`would be a max price of $0.98765 USD per hour. If you set the max price to be `-1`, the instance won't be evicted based on price. The price for the instance will be the current price for Azure Spot Virtual Machine or the price for a standard instance, which ever is less, as long as there is capacity and quota available.
44+
45+
46+
4947
## Eviction policy
5048

5149
When creating a scale set using Azure Spot Virtual Machines, you can set the eviction policy to *Deallocate* (default) or *Delete*.
@@ -56,15 +54,20 @@ If you would like your instances to be deleted when they are evicted, you can se
5654

5755
Users can opt in to receive in-VM notifications through [Azure Scheduled Events](../virtual-machines/linux/scheduled-events.md). This will notify you if your VMs are being evicted and you will have 30 seconds to finish any jobs and perform shutdown tasks prior to the eviction.
5856

59-
<a name="bkmk_try"></a>
60-
## Try & restore (preview)
57+
## Eviction history
58+
You can see historical pricing and eviction rates per size in a region in the portal. Select **View pricing history and compare prices in nearby regions** to see a table or graph of pricing for a specific size. The pricing and eviction rates in the following images are only examples.
6159

62-
This new platform-level feature will use AI to automatically try to restore evicted Azure Spot Virtual Machine instances inside a scale set to maintain the target instance count.
60+
**Chart**:
6361

64-
> [!IMPORTANT]
65-
> Try & restore is currently in public preview.
66-
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
67-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
62+
:::image type="content" source="../virtual-machines/media/spot-chart.png" alt-text="Screenshot of the region options with the difference in pricing and eviction rates as a chart.":::
63+
64+
**Table**:
65+
66+
:::image type="content" source="../virtual-machines/media/spot-table.png" alt-text="Screenshot of the region options with the difference in pricing and eviction rates as a table.":::
67+
68+
## Try & restore
69+
70+
This platform-level feature will use AI to automatically try to restore evicted Azure Spot Virtual Machine instances inside a scale set to maintain the target instance count.
6871

6972
Try & restore benefits:
7073
- Attempts to restore Azure Spot Virtual Machines evicted due to capacity.
@@ -74,49 +77,6 @@ Try & restore benefits:
7477

7578
Try & restore is disabled in scale sets that use [Autoscale](virtual-machine-scale-sets-autoscale-overview.md). The number of VMs in the scale set is driven by the autoscale rules.
7679

77-
### Register for try & restore
78-
79-
Before you can use the try & restore feature, you must register your subscription for the preview. The registration may take several minutes to complete. You can use the Azure CLI or PowerShell to complete the feature registration.
80-
81-
82-
**Use CLI**
83-
84-
Use [az feature register](/cli/azure/feature#az_feature_register) to enable the preview for your subscription.
85-
86-
```azurecli-interactive
87-
az feature register --namespace Microsoft.Compute --name SpotTryRestore
88-
```
89-
90-
Feature registration can take up to 15 minutes. To check the registration status:
91-
92-
```azurecli-interactive
93-
az feature show --namespace Microsoft.Compute --name SpotTryRestore
94-
```
95-
96-
Once the feature has been registered for your subscription, complete the opt-in process by propagating the change into the Compute resource provider.
97-
98-
```azurecli-interactive
99-
az provider register --namespace Microsoft.Compute
100-
```
101-
**Use PowerShell**
102-
103-
Use the [Register-AzProviderFeature](/powershell/module/az.resources/register-azproviderfeature) cmdlet to enable the preview for your subscription.
104-
105-
```azurepowershell-interactive
106-
Register-AzProviderFeature -FeatureName SpotTryRestore -ProviderNamespace Microsoft.Compute
107-
```
108-
109-
Feature registration can take up to 15 minutes. To check the registration status:
110-
111-
```azurepowershell-interactive
112-
Get-AzProviderFeature -FeatureName SpotTryRestore -ProviderNamespace Microsoft.Compute
113-
```
114-
115-
Once the feature has been registered for your subscription, complete the opt-in process by propagating the change into the Compute resource provider.
116-
117-
```azurepowershell-interactive
118-
Register-AzResourceProvider -ProviderNamespace Microsoft.Compute
119-
```
12080

12181
## Placement Groups
12282

@@ -135,8 +95,8 @@ To deploy Azure Spot Virtual Machines on scale sets, you can set the new *Priori
13595

13696
## Portal
13797

138-
The process to create a scale set that uses Azure Spot Virtual Machines is the same as detailed in the [getting started article](quick-create-portal.md). When you are deploying a scale set, you can choose to set the Spot flag, and the eviction policy:
139-
![Create a scale set with Azure Spot Virtual Machines](media/virtual-machine-scale-sets-use-spot/vmss-spot-portal-max-price.png)
98+
The process to create a scale set that uses Azure Spot Virtual Machines is the same as detailed in the [getting started article](quick-create-portal.md). When you are deploying a scale set, you can choose to set the Spot flag, eviction type, eviction policy and if you want to enable try to restore instances:
99+
![Create a scale set with Azure Spot Virtual Machines](media/virtual-machine-scale-sets-use-spot/vmss-spot-portal-1.png)
140100

141101

142102
## Azure CLI
@@ -153,7 +113,10 @@ az vmss create \
153113
--admin-username azureuser \
154114
--generate-ssh-keys \
155115
--priority Spot \
156-
--max-price -1
116+
--eviction-policy Deallocate \
117+
--max-price -1 \
118+
--enable-spot-restore True \
119+
--spot-restore-timeout PT1H
157120
```
158121

159122
## PowerShell
@@ -168,7 +131,10 @@ $vmssConfig = New-AzVmssConfig `
168131
-SkuName "Standard_DS2" `
169132
-UpgradePolicyMode Automatic `
170133
-Priority "Spot" `
171-
-max-price -1
134+
-max-price -1 `
135+
-EnableSpotRestore `
136+
-SpotRestoreTimeout 60 `
137+
-EvictionPolicy delete
172138
```
173139

174140
## Resource Manager templates
@@ -177,7 +143,7 @@ The process to create a scale set that uses Azure Spot Virtual Machines is the s
177143

178144
For Azure Spot Virtual Machine template deployments, use`"apiVersion": "2019-03-01"` or later.
179145

180-
Add the `priority`, `evictionPolicy` and `billingProfile` properties to the `"virtualMachineProfile":`section and the `"singlePlacementGroup": false,` property to the `"Microsoft.Compute/virtualMachineScaleSets"` section in your template:
146+
Add the `priority`, `evictionPolicy`, `billingProfile` and `spotRestoryPolicy` properties to the `"virtualMachineProfile":`section and the `"singlePlacementGroup": false,` property to the `"Microsoft.Compute/virtualMachineScaleSets"` section in your template:
181147

182148
```json
183149

@@ -193,7 +159,11 @@ Add the `priority`, `evictionPolicy` and `billingProfile` properties to the `"vi
193159
"evictionPolicy": "Deallocate",
194160
"billingProfile": {
195161
"maxPrice": -1
196-
}
162+
},
163+
"spotRestorePolicy": {
164+
"enabled": "bool",
165+
"restoreTimeout": "string"
166+
},
197167
},
198168
```
199169

articles/virtual-machines/error-codes-spot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Here are some possible error codes you could receive when using Azure Spot Virtu
3535
| MoveResourcesWithAzureSpotVMNotSupported | The Move resources request contains an Azure Spot Virtual Machine. Not supported. Check the error details for virtual machine Ids. | You cannot move Azure Spot Virtual Machines. |
3636
| MoveResourcesWithAzureSpotVmssNotSupported | The Move resources request contains an Azure Spot virtual machine scale set. Not supported. Check the error details for virtual machine scale set Ids. | You cannot move Azure Spot virtual machine scale set instances. |
3737
| AzureSpotVMNotSupportedInVmssWithVMOrchestrationMode | Azure Spot Virtual Machine is not supported in Virtual machine scale set with VM Orchestration mode. | Set the orchestration mode to virtual machine scale set in order to use Azure Spot Virtual Machine instances. |
38+
| SpotRestorationIsNotSupportedForThisAPIVersion | Spot restoration feature is not supported for this API version. | For an existing scaleset, perform a PATCH using using API version 2021-07-01 or later. <br><br> For new scale set deployments, add the following property to the Azure Resource Manager template using API version 2021-07-01 or later: <br><br> :::image type="content" source="media/spot/spot-try-restore-error-codes-1.png" alt-text="Error code sample to use the correct API version.":::|
39+
| SpotRestorationIsSupportedOnlyForAzureSpotScaleSets | Spot restoration feature is supported only for Azure Spot Virtual Machine scale sets. | Spot restoration feature is only supported for Azure Spot Virtual Machine scale sets. To use this feature, deploy Azure Spot using Virtual Machine scale sets. |
3840

3941

4042
**Next steps**
41-
For more information, see [spot Virtual Machines](./spot-vms.md).
43+
For more information, see [spot Virtual Machines](./spot-vms.md).
3.48 KB
Loading

0 commit comments

Comments
 (0)