'Are Azure Batch virtual machines automatically shut down after a job completes?

I was just curious about the lifecycle of the Azure Batch's virtual machines. Say a VM is created and a task is completed. Is the VM terminated after a successful completion?



Solution 1:[1]

• No, according to the best practices official documentation and the nodes and pools documentation, the Azure VM in a batch doesn’t shutdown unless a repetitive job is initiated. If a repetitive scheduled job is to be executed on a VM in an Azure Batch, then the time period for which the batch job is to be executed is to be defined during the batch job creation itself and resource allocation instance.

Thus, when a batch job on an Azure VM is completed, the Azure VM becomes idle in state and after a defined threshold period, it is deleted. The threshold period is the time for which the Azure VM in the node pool is in hibernation state/idle. Post completion of which and absence of any lined-up task or job, the Azure VM in the node pool gets deleted/deallocated if a spot instance is used.

• Please refer to the below official documentation link on the provisioning of pool and compute node lifetime: -

https://docs.microsoft.com/en-us/azure/batch/nodes-and-pools#pool-and-compute-node-lifetime

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KartikBhiwapurkar-MT