Skip to content

Commit 1055968

Browse files
committed
Hibernation for VMs
1 parent 20a2022 commit 1055968

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

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.
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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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 DevTest Labs
12+
13+
As an Azure DevTest Labs lab owner and user, you can Hibernate the virtual machines (VMs) in your lab. You save the cost of running machines that aren't being used.
14+
15+
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 VM, just like how you aren't charged for VMs in a stop (deallocated) state. You're only charged for the storage (OS disk, data disks) and networking resources (IPs, etc.) attached to the VM.
16+
17+
Hibernate is an effective cost management feature for:
18+
• Scenarios where the VMs don't need to run 24/7.
19+
• Scenarios where you don’t want to lose the state of the applications and processes on your VM when it is deallocated.
20+
• 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.
21+
22+
Hibernation can be either enabled on VM creation or on an existing VM. To enable hibrnation during VM creation, you can use the Azure portal, API, or CLI. Enabling hibernation on an existing VM is currently only possible through the Azure CLI. Hibernation cannot be triggered from the VM, but can be triggered from the API and Portal. I have a change to do it from the CLI in PR now.
23+
24+
[!NOTE]
25+
Please note that Hibernation support is limited to certain VM sizes and OS versions. Make sure you have a supported configuration before using hibernation.
26+
To learn more about Hibernation in general, its supported configurations in Azure, and other limitations, please visit
27+
- [Hibernation for Azure Virtual Machines](https://learn.microsoft.com/en-us/azure/virtual-machines/hibernate-resume)
28+
29+
This article explains how to Hibernate VMs in DevTest Labs.
30+
31+
# Create lab virtual machines with Hibernation enabled in Azure DevTest Labs
32+
33+
This article describes how to create Azure virtual machines (VMs) with Hibernation enabled in Azure DevTest Labs by using the Azure portal.
34+
35+
## Prerequisite
36+
37+
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).
38+
39+
<a name="create-and-add-virtual-machines"></a>
40+
## Configure basic settings
41+
42+
1. In the [Azure portal](https://portal.azure.com), go to the **Overview** page for the lab.
43+
44+
1. On the lab **Overview** page, select **Add**.
45+
46+
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-add-vm.png" alt-text="Lab overview page showing add button.":::
47+
48+
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.
49+
50+
1. On the **Basics Settings** tab of the **Create lab resource** screen, provide the following information:
51+
52+
- **Virtual machine name**: Keep the autogenerated name, or enter another unique VM name.
53+
- **User name**: Keep the user name, or enter another user name to grant administrator privileges on the VM.
54+
- **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).
55+
- **Password**: If you don't choose to use a secret, enter a VM password between 8 and 123 characters long.
56+
- **Save as default password**: Select this checkbox to save the password in the Key Vault associated with the lab.
57+
- **Virtual machine size**: Keep the default value for the base, or select **Change Size** to select different sizes.
58+
- **Hibernation**: Select **Enabled** to enable hibernation for this virtual machine.
59+
- **OS disk type**: Keep the default value for the base, or select a different option from the dropdown list.
60+
- **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.
61+
62+
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-vm-basic-settings.png" alt-text="Virtual machine basic settings page.":::
63+
64+
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.
65+
66+
During VM deployment, you can select the **Notifications** icon at the top of the screen to see progress. Creating a VM takes a while.
67+
68+
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.
69+
70+
To learn more about how to create Azure virtual machines (VMs) in Azure DevTest Labs in general, please visit [Create lab virtual machines in Azure DevTest Labs](devtest-lab-create-lab.md)
71+
72+
## Hibernating a running VM in Azure DevTest Labs
73+
74+
1. Sign in to the [Azure portal](https://portal.azure.com).
75+
76+
1. In the search bar, search for and select **DevTest Labs**.
77+
78+
:::image type="content" source="./media/connect-windows-virtual-machine/search-select.png" alt-text="Search for and select DevTest Labs":::
79+
1. From the list of labs, select your **lab**.
80+
81+
:::image type="content" source="./media/connect-windows-virtual-machine/select-lab.png" alt-text="Select your lab":::
82+
1. On the home page for your lab, select the VM from the **My virtual machines** list.
83+
84+
:::image type="content" source="./media/connect-windows-virtual-machine/select-windows-vm.png" alt-text="Select your Windows VM":::
85+
1. On the **Virtual machine** page for your VM, select **Hibernate** on the toolbar. The VM hould be in a running state for Hibernate to be enabled.
86+
87+
:::image type="content" source="./media/connect-windows-virtual-machine/select-connect.png" alt-text="Select connect on the toolbar":::
45.8 KB
Loading

0 commit comments

Comments
 (0)