0
0
Azurecloud~30 mins

Spot VMs for cost savings in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Spot VMs for cost savings
📖 Scenario: You are managing cloud resources for a small company. You want to save money by using Spot Virtual Machines (VMs) in Azure. Spot VMs let you use unused capacity at a lower price but can be evicted when Azure needs the resources back.Your task is to create an Azure Resource Manager (ARM) template that deploys a Spot VM with specific settings to save costs.
🎯 Goal: Build an ARM template that deploys a Spot VM with eviction policy set to Deallocate, and a maximum price set to save costs.
📋 What You'll Learn
Create a resource group variable
Define a VM resource with Spot VM priority
Set eviction policy to Deallocate
Set maximum price for the Spot VM
💡 Why This Matters
🌍 Real World
Spot VMs help companies save money by using unused cloud capacity at a lower price, suitable for flexible workloads.
💼 Career
Cloud engineers often configure Spot VMs to optimize costs while managing eviction risks in production or development environments.
Progress0 / 4 steps
1
Create resource group and basic VM variables
Create a variable called resourceGroupName and set it to "myResourceGroup". Then create a variable called vmName and set it to "mySpotVM".
Azure
Need a hint?

Use var to declare variables and assign the exact string values.

2
Add Spot VM priority and eviction policy variables
Add a variable called priority and set it to "Spot". Then add a variable called evictionPolicy and set it to "Deallocate".
Azure
Need a hint?

Spot VMs use priority set to "Spot" and eviction policy can be "Deallocate".

3
Add maximum price variable for Spot VM
Add a variable called maxPrice and set it to -1 to allow the Spot VM to use the current market price.
Azure
Need a hint?

Setting maxPrice to -1 means the VM will pay up to the current Spot price.

4
Define the Spot VM resource with priority, eviction policy, and max price
Create a JSON object called spotVMResource representing the VM resource. Include the priority, evictionPolicy, and maxPrice properties in the properties section of the VM resource. Use the variables vmName, priority, evictionPolicy, and maxPrice in the object.
Azure
Need a hint?

Use the variables inside the JSON object for the VM resource. Include priority, evictionPolicy, and maxPrice in the correct places.