How to Resize an Azure VM Spot Instance
While it may seem straightforward, there isn't currently a way to update an Azure Spot Instance VM size in the Azure Portal.
As always, I fallback to the Azure CLI, which is far more powerful and flexible than the Portal.
Warning: the following process may cause a brief interruption and restart of your VM. Additionally, if you use Ephemeral Disks, they will be wiped during the resize operation.
Steps:
- Ensure you are on the most recent version of the Azure CLI. Older version do not support Spot Instances.
az vm resize \
--name {VM Name} \
--resource-group {Resource Group Name} \
--subscription {Subscription Id} \
--size Standard_D2s_v3
Hint: if you are unsure of available VM names:
az vm list-vm-resize-options \
--name {VM Name} \
--resource-group {Resource Group Name} \
--subscription {Subscription Id}
That's it. Thank you for reading. I'd love to hear your thoughts or any questions that you may have.