Skip to content

Commit 817d041

Browse files
Merge pull request #209726 from ju-shim/spot-all
Spot - ARG - pricing history and eviction rate
2 parents 1ddd11b + 09b9a76 commit 817d041

File tree

7 files changed

+65
-28
lines changed

7 files changed

+65
-28
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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: mimckitt
5-
ms.author: mimckitt
4+
author: ju-shim
5+
ms.author: jushiman
66
ms.topic: how-to
77
ms.service: virtual-machine-scale-sets
88
ms.subservice: spot
@@ -71,7 +71,7 @@ Try & restore benefits:
7171
- Attempts to restore Azure Spot Virtual Machines evicted due to capacity.
7272
- Restored Azure Spot Virtual Machines are expected to run for a longer duration with a lower probability of a capacity triggered eviction.
7373
- Improves the lifespan of an Azure Spot Virtual Machine, so workloads run for a longer duration.
74-
- Helps Virtual Machine Scale Sets to maintain the target count for Azure Spot Virtual Machines, similar to maintain target count feature that already exist for Pay-As-You-Go VMs.
74+
- Helps Virtual Machine Scale Sets to maintain the target count for Azure Spot Virtual Machines, similar to maintain target count feature that already exists for Pay-As-You-Go VMs.
7575

7676
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.
7777

@@ -93,7 +93,7 @@ To deploy Azure Spot Virtual Machines on scale sets, you can set the new *Priori
9393

9494
## Portal
9595

96-
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:
96+
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 try to restore instances:
9797
![Create a scale set with Azure Spot Virtual Machines](media/virtual-machine-scale-sets-use-spot/vmss-spot-portal-1.png)
9898

9999

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Error codes for Azure Spot Virtual Machines and scale sets instances
33
description: Learn about error codes that you could possibly see when using Azure Spot Virtual Machines and scale set instances.
4-
author: cynthn
4+
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: spot
77
ms.workload: infrastructure-services
88
ms.topic: troubleshooting
99
ms.date: 03/25/2020
10-
ms.author: cynthn
10+
ms.author: jushiman
1111
#pmcontact: jagaveer
1212
---
1313

articles/virtual-machines/linux/spot-cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Use CLI to deploy Azure Spot Virtual Machines
33
description: Learn how to use the CLI to deploy Azure Spot Virtual Machines to save costs.
4-
author: cynthn
4+
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: spot
77
ms.workload: infrastructure-services
88
ms.topic: how-to
99
ms.date: 03/22/2021
10-
ms.author: cynthn
11-
ms.reviewer: jagaveer
10+
ms.author: jushiman
11+
ms.reviewer: cynthn
1212
---
1313

1414
# Deploy Azure Spot Virtual Machines using the Azure CLI

articles/virtual-machines/linux/spot-template.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Use a template to deploy Azure Azure Spot Virtual Machines
2+
title: Use a template to deploy Azure Spot Virtual Machines
33
description: Learn how to use a template to deploy Azure Spot Virtual Machines to save costs.
4-
author: cynthn
4+
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: spot
77
ms.workload: infrastructure-services
88
ms.topic: how-to
99
ms.date: 03/25/2020
10-
ms.author: cynthn
11-
ms.reviewer: jagaveer
10+
ms.author: jushiman
11+
ms.reviewer: cynthn
1212
---
1313

1414
# Deploy Azure Spot Virtual Machines using a Resource Manager template
@@ -19,7 +19,7 @@ Using [Azure Spot Virtual Machines](../spot-vms.md) allows you to take advantage
1919

2020
Pricing for Azure Spot Virtual Machines is variable, based on region and SKU. For more information, see VM pricing for [Linux](https://azure.microsoft.com/pricing/details/virtual-machines/linux/) and [Windows](https://azure.microsoft.com/pricing/details/virtual-machines/windows/).
2121

22-
You have option to set a max price you are willing to pay, per hour, for the VM. The max price for a Azure Spot Virtual Machine can be set in US dollars (USD), using up to 5 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 VM won't be evicted based on price. The price for the VM will be the current price for Azure Spot Virtual Machines or the price for a standard VM, which ever is less, as long as there is capacity and quota available. For more information about setting the max price, see [Azure Spot Virtual Machines - Pricing](../spot-vms.md#pricing).
22+
You have option to set a max price you are willing to pay, per hour, for the VM. The max price for an Azure Spot Virtual Machine can be set in US dollars (USD), using up to 5 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 VM won't be evicted based on price. The price for the VM will be the current price for Azure Spot Virtual Machines or the price for a standard VM, which ever is less, as long as there is capacity and quota available. For more information about setting the max price, see [Azure Spot Virtual Machines - Pricing](../spot-vms.md#pricing).
2323

2424

2525
## Use a template
@@ -34,7 +34,7 @@ For Azure Spot Virtual Machine template deployments, use`"apiVersion": "2019-03-
3434
}
3535
```
3636

37-
Here is a sample template with the added properties for a Azure Spot Virtual Machine. Replace the resource names with your own and `<password>` with a password for the local administrator account on the VM.
37+
Here is a sample template with the added properties for an Azure Spot Virtual Machine. Replace the resource names with your own and `<password>` with a password for the local administrator account on the VM.
3838

3939
```json
4040
{
@@ -173,7 +173,7 @@ Here is a sample template with the added properties for a Azure Spot Virtual Mac
173173

174174
## Simulate an eviction
175175

176-
You can [simulate an eviction](/rest/api/compute/virtualmachines/simulateeviction) of a Azure Spot Virtual Machine, to testing how well your application will repond to a sudden eviction.
176+
You can [simulate an eviction](/rest/api/compute/virtualmachines/simulateeviction) of an Azure Spot Virtual Machine, to testing how well your application will repond to a sudden eviction.
177177

178178
Replace the following with your information:
179179

@@ -188,7 +188,7 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
188188

189189
## Next steps
190190

191-
You can also create a Azure Spot Virtual Machine using [Azure PowerShell](../windows/spot-powershell.md) or the [Azure CLI](spot-cli.md).
191+
You can also create an Azure Spot Virtual Machine using [Azure PowerShell](../windows/spot-powershell.md) or the [Azure CLI](spot-cli.md).
192192

193193
Query current pricing information using the [Azure retail prices API](/rest/api/cost-management/retail-prices/azure-retail-prices) for information about Azure Spot Virtual Machine pricing. The `meterName` and `skuName` will both contain `Spot`.
194194

articles/virtual-machines/spot-portal.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Use the portal to deploy Azure Spot Virtual Machines
33
description: How to use the Portal to deploy Spot Virtual Machines
4-
author: cynthn
4+
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: spot
77
ms.workload: infrastructure-services
88
ms.topic: how-to
99
ms.date: 09/14/2020
10-
ms.author: cynthn
11-
ms.reviewer: jagaveer
10+
ms.author: jushiman
11+
ms.reviewer: cynthn
1212
---
1313

1414
# Deploy Azure Spot Virtual Machines using the Azure portal
@@ -19,7 +19,7 @@ Using [Azure Spot Virtual Machines](spot-vms.md) allows you to take advantage of
1919

2020
Pricing for Azure Spot Virtual Machines is variable, based on region and SKU. For more information, see VM pricing for [Linux](https://azure.microsoft.com/pricing/details/virtual-machines/linux/) and [Windows](https://azure.microsoft.com/pricing/details/virtual-machines/windows/). For more information about setting the max price, see [Azure Spot Virtual Machines - Pricing](spot-vms.md#pricing).
2121

22-
You have option to set a max price you are willing to pay, per hour, for the VM. The max price for a Azure Spot Virtual Machine can be set in US dollars (USD), using up to 5 decimal places. For example, the value `0.05701`would be a max price of $0.05701 USD per hour. If you set the max price to be `-1`, the VM won't be evicted based on price. The price for the VM will be the current price for spot or the price for a standard VM, which ever is less, as long as there is capacity and quota available.
22+
You have option to set a max price you are willing to pay, per hour, for the VM. The max price for an Azure Spot Virtual Machine can be set in US dollars (USD), using up to 5 decimal places. For example, the value `0.05701`would be a max price of $0.05701 USD per hour. If you set the max price to be `-1`, the VM won't be evicted based on price. The price for the VM will be the current price for spot or the price for a standard VM, which ever is less, as long as there is capacity and quota available.
2323

2424
When the VM is evicted, you have the option to either delete the VM and the underlying disk or deallocate the VM so that it can be restarted later.
2525

@@ -47,7 +47,7 @@ You can change the region by selecting the choice that works the best for you an
4747

4848
## Simulate an eviction
4949

50-
You can [simulate an eviction](/rest/api/compute/virtualmachines/simulateeviction) of a Azure Spot Virtual Machine, to testing how well your application will respond to a sudden eviction.
50+
You can [simulate an eviction](/rest/api/compute/virtualmachines/simulateeviction) of an Azure Spot Virtual Machine, to testing how well your application will respond to a sudden eviction.
5151

5252
Replace the following with your information:
5353

articles/virtual-machines/spot-vms.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Use Azure Spot Virtual Machines
33
description: Learn how to use Azure Spot Virtual Machines to save on costs.
4-
author: JagVeerappan
5-
ms.author: jagaveer
4+
author: ju-shim
5+
ms.author: jushiman
66
ms.service: virtual-machines
77
ms.subservice: spot
88
ms.workload: infrastructure-services
@@ -29,7 +29,7 @@ The *Deallocate* policy moves your VM to the stopped-deallocated state, allowing
2929

3030
If you would like your VM to be deleted when it is evicted, you can set the eviction policy to *delete*. The evicted VMs are deleted together with their underlying disks, so you will not continue to be charged for the storage.
3131

32-
You can opt-in to receive in-VM notifications through [Azure Scheduled Events](./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.
32+
You can opt in to receive in-VM notifications through [Azure Scheduled Events](./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.
3333

3434

3535
| Option | Outcome |
@@ -72,6 +72,8 @@ With variable pricing, you have option to set a max price, in US dollars (USD),
7272

7373
## Pricing and eviction history
7474

75+
### Portal
76+
7577
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.
7678

7779
**Chart**:
@@ -82,7 +84,42 @@ You can see historical pricing and eviction rates per size in a region in the po
8284

8385
:::image type="content" source="./media/spot-table.png" alt-text="Screenshot of the region options with the difference in pricing and eviction rates as a table.":::
8486

87+
### Azure Resource Graph
88+
89+
You can programmatically access relevant Spot VM SKU data through [Azure Resource Graph](/azure/governance/resource-graph/overview). Get pricing history in the last 90 days and eviction rates for the last 28 trailing days to identify SKUs that better meet your specific needs.
90+
91+
Key benefits:
92+
- Query Spot eviction rates and the last few months of Spot prices programmatically through ARM or the [ARG Explorer in Azure portal](/azure/governance/resource-graph/first-query-portal)
93+
- Create a custom query to extract the specific data relevant to your scenario with the ability to filter across a variety of parameters, such as SKU and region 
94+
- Easily compare data across multiple regions and SKUs 
95+
- Find a different Spot SKU or region with a lower price and/or eviction rate 
96+
97+
Try out the following sample queries for Spot pricing history and eviction rates using the [ARG Explorer in Azure portal](/azure/governance/resource-graph/first-query-portal). Spot pricing history and eviction rates data are available in the `SpotResources` table. 
98+
99+
**Spot pricing history sample query**:
100+
101+
```sql
102+
SpotResources
103+
| where type =~ 'microsoft.compute/skuspotpricehistory/ostype/location'
104+
| wheresku.namein~ ('standard_d2s_v4', 'standard_d4s_v4')
105+
| whereproperties.osType=~ 'linux'
106+
| where location in~ ('eastus', 'southcentralus')
107+
| project skuName = tostring(sku.name), osType = tostring(properties.osType), location, latestSpotPriceUSD = todouble(properties.spotPrices[0].priceUSD)
108+
| order by latestSpotPriceUSD asc
109+
```
110+
111+
**Spot eviction rates sample query**:
112+
113+
```sql
114+
SpotResources
115+
| where type =~ 'microsoft.compute/skuspotevictionrate/location'
116+
| wheresku.namein~ ('standard_d2s_v4', 'standard_d4s_v4')
117+
| where location in~ ('eastus', 'southcentralus')
118+
| project skuName = tostring(sku.name), location, spotEvictionRate = tostring(properties.evictionRate)
119+
| order by skuName asc, location asc
120+
```
85121

122+
Alternatively, try out the [ARG REST API](/rest/api/azure-resourcegraph/) to get the pricing history and eviction rate history data.
86123

87124
## Frequently asked questions
88125

articles/virtual-machines/windows/spot-powershell.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Use PowerShell to deploy Azure Spot Virtual Machines
33
description: Learn how to use Azure PowerShell to deploy Azure Spot Virtual Machines to save on costs.
4-
author: cynthn
4+
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: spot
77
ms.workload: infrastructure-services
88
ms.topic: how-to
99
ms.date: 03/22/2021
10-
ms.author: cynthn
11-
ms.reviewer: jagaveer
10+
ms.author: jushiman
11+
ms.reviewer: cynthn
1212
ms.custom: devx-track-azurepowershell
1313
---
1414

0 commit comments

Comments
 (0)