Skip to content

Commit 282d0f7

Browse files
authored
Merge pull request #293024 from anishtrakru/dtl-hibernate
Hibernation for VMs
2 parents 3b3e89e + a897c7d commit 282d0f7

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed

articles/devtest-labs/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
href: connect-virtual-machine-through-browser.md
136136
- name: Start or stop a VM using PowerShell or CLI
137137
href: use-command-line-start-stop-virtual-machines.md
138+
- name: Hibernate a VM
139+
href: devtest-lab-hibernate-vm.md
138140
- name: Restart a VM
139141
href: devtest-lab-restart-vm.md
140142
- name: Resize a VM

articles/devtest-labs/devtest-lab-add-vm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You need at least [user](devtest-lab-add-devtest-user.md#devtest-labs-user) acce
3535
- **Password**: If you don't choose to use a secret, enter a VM password between 8 and 123 characters long.
3636
- **Save as default password**: Select this checkbox to save the password in the Key Vault associated with the lab.
3737
- **Virtual machine size**: Keep the default value for the base, or select **Change Size** to select different sizes.
38+
- **Hibernation**: Select **Enabled** to enable hibernation for this virtual machine. If you enable Hibernation, you also must select **Public IP** in the Advanced settings as Private and Shared IP are currently not supported if Hibernation is enabled.
3839
- **OS disk type**: Keep the default value for the base, or select a different option from the dropdown list.
3940
- **Artifacts**: This field shows the number of artifacts already configured for this VM base. Optionally, select **Add or Remove Artifacts** to select and configure artifacts to add to the VM.
4041

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Hibernation for virtual machines
3+
description: Learn how to hibernate individual virtual machines (VMs) in Azure DevTest Labs.
4+
ms.topic: how-to
5+
ms.author: anishtrakru
6+
author: RoseHJM
7+
ms.date: 01/20/2025
8+
ms.custom: UpdateFrequency2
9+
---
10+
11+
# Hibernate VMs in Azure DevTest Labs
12+
13+
As an Azure DevTest Labs lab owner and user, you can Hibernate the virtual machines (VMs) in your lab. Hibernation allows applications and processes that were previously running in your VM resume from the state prior to hibernation. When you hibernate a machine, Azure stores the memory contents of the VM in the OS disk and then deallocates the VM. When the VM is started again from its hibernation state, the memory contents are transferred from the OS disk back into memory. Once a VM is placed in a hibernated state, you aren't charged for the compute cost of the VM, just like how you aren't charged for it in a stopped (deallocated) state. You're only charged for the storage (OS disk, data disks) and networking resources (IPs, etc.) attached to the VM.
14+
15+
Hibernate is an effective cost management feature for:
16+
- Scenarios where the VMs don't need to run 24/7.
17+
- Scenarios where you don’t want to lose the state of the applications and processes on your VM when it is deallocated.
18+
- Systems with long boot times due to memory intensive applications. These applications can be initialized on VMs and hibernated. These “prewarmed” VMs can then be quickly started when needed, with the applications already up and running in the desired state.
19+
20+
Azure DevTest Labs currently only supports enabling Hibernation on VM creation. To enable hibernation during VM creation, you can use the Azure portal and API. Hibernation can only be triggered from the API and the Azure portal and not directly from the VM.
21+
22+
> [!NOTE]
23+
> Please note that Hibernation support is limited to certain VM sizes and OS versions. Make sure you have a supported configuration before using hibernation. To learn more about Hibernation in general, its supported configurations in Azure, and other limitations, please visit [Hibernation for Azure Virtual Machines](https://learn.microsoft.com/azure/virtual-machines/hibernate-resume)
24+
25+
This article explains how to Hibernate VMs in DevTest Labs.
26+
27+
## Create lab virtual machines with Hibernation enabled in Azure DevTest Labs
28+
29+
This article describes how to create Azure virtual machines (VMs) with Hibernation enabled in Azure DevTest Labs by using the Azure portal.
30+
31+
### Prerequisite
32+
33+
You need at least [user](devtest-lab-add-devtest-user.md#devtest-labs-user) access to a lab in DevTest Labs. For more information about creating labs, see [Create a lab in the Azure portal](devtest-lab-create-lab.md).
34+
35+
<a name="create-and-add-virtual-machines"></a>
36+
37+
### Configure basic settings
38+
39+
1. In the [Azure portal](https://portal.azure.com), go to the **Overview** page for the lab.
40+
41+
1. On the lab **Overview** page, select **Add**.
42+
43+
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-add-vm.png" alt-text="Screenshot of lab overview page showing add button.":::
44+
45+
1. On the **Choose a base** page, select an image for the VM. You can choose Marketplace images, custom images, or formulas that the lab owner made available. The following instructions use Windows 11 Pro. Some bases might have different settings.
46+
47+
1. On the **Basics Settings** tab of the **Create lab resource** screen, provide the following information:
48+
49+
- **Virtual machine name**: Keep the autogenerated name, or enter another unique VM name.
50+
- **User name**: Keep the user name, or enter another user name to grant administrator privileges on the VM.
51+
- **Use a saved secret**: Select this checkbox to use a secret from Azure Key Vault instead of a password to access the VM. If you select this option, under **Secret**, select the secret to use from the dropdown list. For more information, see [Store secrets in a key vault](devtest-lab-store-secrets-in-key-vault.md).
52+
- **Password**: If you don't choose to use a secret, enter a VM password between 8 and 123 characters long.
53+
- **Save as default password**: Select this checkbox to save the password in the Key Vault associated with the lab.
54+
- **Virtual machine size**: Keep the default value for the base, or select **Change Size** to select different sizes.
55+
- **Hibernation**: Select **Enabled** to enable hibernation for this virtual machine. If you enable Hibernation, you also must select **Public IP** in the Advanced settings as Private and Shared IP are currently not supported if Hibernation is enabled.
56+
- **OS disk type**: Keep the default value for the base, or select a different option from the dropdown list.
57+
- **Artifacts**: This field shows the number of artifacts already configured for this VM base. Optionally, select **Add or Remove Artifacts** to select and configure artifacts to add to the VM.
58+
59+
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-vm-basic-settings.png" alt-text="Screenshot showing virtual machine basic settings page.":::
60+
61+
1. After you configure all settings, on the **Basic Settings** tab of the **Create lab resource** screen, select **Create** to deploy the VM with Hibernation enabled.
62+
63+
During VM deployment, you can select the **Notifications** icon at the top of the screen to see progress. Creating a VM takes a while.
64+
65+
When the deployment is complete, if you kept yourself as VM owner, the VM appears under **My virtual machines** on the lab **Overview** page. To connect to the VM, select it from the list, and then select **Connect** on the VM's **Overview** page. If the VM is stopped, select **Start** first to start the VM.
66+
67+
To learn more about how to create virtual machines (VMs) in Azure DevTest Labs in general, please visit [Create and add virtual machines to a lab in Azure DevTest Labs](devtest-lab-add-vm.md)
68+
69+
## Hibernating a running VM in Azure DevTest Labs
70+
71+
1. Sign in to the [Azure portal](https://portal.azure.com).
72+
73+
1. In the search bar, search for and select **DevTest Labs**.
74+
75+
:::image type="content" source="./media/connect-windows-virtual-machine/search-select.png" alt-text="Screenshot showing search for and select DevTest Labs.":::
76+
1. From the list of labs, select your **lab**.
77+
78+
:::image type="content" source="./media/connect-windows-virtual-machine/select-lab.png" alt-text="Screenshot showing select your lab.":::
79+
1. On the home page for your lab, select the VM from the **My virtual machines** list for which you had enabled Hibernation on VM creation.
80+
81+
:::image type="content" source="./media/connect-windows-virtual-machine/select-windows-vm.png" alt-text="Screenshot showing select your Windows VM.":::
82+
1. On the **Virtual machine** page for your VM, select **Hibernate** on the toolbar. The VM status should be in a running state for Hibernate option to be enabled.
83+
84+
:::image type="content" source="./media/devtest-lab-hibernate/devtest-lab-hibernate-vm.png" alt-text="Screenshot showing select connect on the toolbar.":::
85+
86+
Once you select Hibernate, it will trigger the Hibernation process. Once the Hibernation process is completed, the status will be updated to Hibernated (deallocated).
45.8 KB
Loading
199 KB
Loading
104 KB
Loading

0 commit comments

Comments
 (0)