How can we automate the timely re-allocation of a single evicted Spot VM in Azure?

KindCompute 20 Reputation points
2024-07-07T18:54:12.94+00:00

For a workload, I want to set up a Single Spot Priority VM. What I'm looking for is a method that automatically tries to re-allocate that single spot VM frequently. I have checked Availability Set and Scalability Set documents but couldn't find a solution for a Single Spot VM. When selecting a Spot VM, Availability Set becomes disabled, and for Scale Set, at least one regular VM is required, so that's not the case.

Also, Scale set document, there is a section named 'Try & Restore' but I couldn't find additional documentation on how to deploy it. I'm not sure if it will work for a single spot VM or not.

Is there any Azure native solution that can automatically try to reallocate a single evicted VM, for example, every 5 minutes? or Should we use a combination of other methods, such as Terraform, Azure CLI, or serverless functions?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,540 questions
{count} votes

Accepted answer
  1. Nikhil Duserla 970 Reputation points Microsoft Vendor
    2024-07-08T11:01:21.3933333+00:00

    Hi KindCompute ,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    We understand from your query that there isn't a native Azure solution that allows you to automatically reallocate a single Spot VM frequently, especially when it's evicted.

    The limitations you've encountered are indeed accurate.

    • Availability Sets don't support Spot VMs.
    • Scale Sets require at least one regular VM, and the "Try & Restore" feature is not applicable to a single Spot VM.

    Click here How to Automate Azure VM Evictions Start Ups with Azure Functions

    If you have any further queries, do let us know.

    If the answer is helpful, please click "Accept Answer" and "Upvote it."


0 additional answers

Sort by: Most helpful