Optimize Your Azure Costs with VM Hibernation – Cost saving for Azure Virtual Desktop

3 Jun

Azure Virtual Machines (VMs) are a powerful tool for running applications, hosting desktops, and performing various tasks in the cloud. However, the cost of running VMs can add up quickly, especially if they are left running when not in use. Microsoft has introduced a new feature called VM Hibernation, which allows you to save costs by hibernating your VMs when they are not needed. In this blog post, we will explore the benefits of VM Hibernation and how you can use it to optimize your Azure costs.

What is VM Hibernation

VM Hibernation is a cost-saving feature that allows you to deallocate a VM while preserving its in-memory state. When a VM is hibernated, you don’t pay for the compute costs associated with the VM. Instead, you only pay for the storage and networking resources associated with the VM. This means you can save a significant amount of money on your Azure bill by hibernating VMs when they are not in use. Obviously this wont work on its own you will have to intergrate this further with Scaling Plans & Azure Automation.

Use Cases for VM Hibernation

CategoryDescription
Virtual DesktopsIf you use Azure Virtual Desktop to provide virtual desktops (Personal Only) to your employees, you can use VM Hibernation to save costs during non-business hours. By hibernating the VMs after business hours and resuming them the next morning, you can avoid paying for compute resources when they are not needed.
Dev/Test EnvironmentsIf you have development or testing environments that are not used 24/7, you can use VM Hibernation to save costs. By hibernating the VMs when they are not in use, you can avoid paying for compute resources that are not needed.
Prewarmed VMsIf you have applications that have long initialization times due to memory components, you can use VM Hibernation to save costs. By bringing up the apps and hibernating the VMs, you can quickly start the “prewarmed” VMs when needed, with the applications up and running in the desired state.

How to Enable Hibernation

Enabling hibernation is straightforward and can be done using various tools like Azure Portal, PowerShell, CLI, ARM, SDKs, and APIs. etc. I will be demonstrating within the Azure Portal:

  • Create a Host Pool – Select Personal
    • Under the Host Pool creation ensure you have Personal selected as this doesn’t work for Pooled
  • Under Host Pools –> Virtual Machine –> Select Hibernate

Hibernate is only available for personal host pools. For more information, see Hibernation in virtual machines.

Configuring Scaling Plans

To take full advantage of VM Hibernation, you can configure scaling plans for your VMs. Scaling plans allow you to automatically hibernate VMs based on a schedule or based on user activity.

  • Start VM on Connect – Ensure that is “Yes
  • Configure Hibernation Settings
    • Define hibernation after a user session disconnects or logs off for a configurable period.
  • Assign the Scaling Plan
    • Apply the scaling plan to one or more personal host pools.

Following are the list of helpful links:

DescriptionLinks
Hibernation support now available for Azure Virtual DesktopHibernation support now available for Azure Virtual Desktop | Azure Virtual Desktop Blog (microsoft.com)
Cost Optimization for General Purpose VMs using Hibernation now Generally AvailableCost Optimization for General Purpose VMs using Hibernation now Generally Available – Microsoft Community Hub

VM Hibernation is a powerful cost-saving feature that can help you optimize your Azure costs. By hibernating VMs when they are not in use, you can save a significant amount of money on your Azure bill. Whether you are using VMs for virtual desktops, dev/test environments, or prewarmed VMs, VM Hibernation can help you save costs without sacrificing performance or availability. Do give it a try in your enivornment and see how much you can save?

Thanks,
Aresh Sarkari

One Response to “Optimize Your Azure Costs with VM Hibernation – Cost saving for Azure Virtual Desktop”

Trackbacks/Pingbacks

  1. AVD Community Newsletter – 6th June 2024 – AVD Community - June 6, 2024

    […] Aresh Sarkari has written a blogpost on saving cost of Azure Virtual Desktop using the hibernate feature. You can read more here – Optimize Your Azure Costs with VM Hibernation – Cost saving for Azure Virtual Desktop | AskAresh […]

Leave a Reply

Discover more from AskAresh

Subscribe now to keep reading and get access to the full archive.

Continue reading