You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/snapshot-copy-managed-disk.md
+22-24Lines changed: 22 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
---
2
-
title: Create an Azure snapshot of a virtual hard drive
2
+
title: Create an Azure snapshot of a virtual hard disk
3
3
description: Learn how to create a copy of an Azure VM to use as a backup or for troubleshooting issues using the portal, PowerShell, or CLI.
4
4
author: roygara
5
5
ms.author: rogarana
6
6
ms.service: storage
7
7
ms.subservice: disks
8
8
ms.workload: infrastructure-services
9
9
ms.topic: how-to
10
-
ms.date: 08/20/2021
10
+
ms.date: 09/07/2021
11
11
---
12
12
13
-
# Create a snapshot of a virtual hard drive
13
+
# Create a snapshot of a virtual hard disk
14
14
15
15
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Windows VMs :heavy_check_mark: Flexible scale sets
16
16
17
-
A snapshot is a full, read-only copy of a virtual hard drive (VHD). You can use a snapshot as a point-in-time backup, or to help troubleshoot virtual machine (VM) issues. You can take a snapshot of both operating system (OS) or data disk VHDs.
17
+
A snapshot is a full, read-only copy of a virtual hard disk (VHD). You can use a snapshot as a point-in-time backup, or to help troubleshoot virtual machine (VM) issues. You can take a snapshot of both operating system (OS) or data disk VHDs.
18
18
19
-
If you want to use a snapshot to create a new VM, ensure that you first cleanly shut down the VM. This action clears any processes that are in progress.
19
+
## Create a snapshot of a VHD
20
20
21
-
## Create a snapshot of a virtual hard drive
21
+
If you want to use a snapshot to create a new VM, ensure that you first cleanly shut down the VM. This action clears any processes that are in progress.
22
22
23
23
# [Portal](#tab/portal)
24
24
@@ -27,12 +27,8 @@ To create a snapshot using the Azure portal, complete these steps.
27
27
1. In the [Azure portal](https://portal.azure.com), select **Create a resource**.
28
28
1. Search for and select **Snapshot**.
29
29
1. In the **Snapshot** window, select **Create**. The **Create snapshot** window appears.
30
-
1. For **Resource group**, select an existing [resource group](../azure-resource-manager/management/overview.md#resource-groups) or enter the name of a new one.
31
-
1. Enter a **Name**, then select a **Region** and **Snapshot type** for the new snapshot.
32
-
33
-
> [!NOTE]
34
-
> If you would like to store your snapshot in zone-resilient storage, you need to select a region that supports [availability zones](../availability-zones/az-overview.md). For a list of supporting regions, see [Azure regions with availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones).
35
-
30
+
1. For **Resource group**, select an existing [resource group](../azure-resource-manager/management/overview#resource-groups) or enter the name of a new one.
31
+
1. Enter a **Name**, then select a **Region** and **Snapshot type** for the new snapshot. If you would like to store your snapshot in zone-resilient storage, you need to select a region that supports [availability zones](../availability-zones/az-overview). For a list of supporting regions, see [Azure regions with availability zones](../availability-zones/az-region#azure-regions-with-availability-zones).
36
32
1. For **Source subscription**, select the subscription that contains the managed disk to be backed up.
37
33
1. For **Source disk**, select the managed disk to snapshot.
38
34
1. For **Storage type**, select **Standard HDD**, unless you require zone-redundant storage or high-performance storage for your snapshot.
@@ -41,9 +37,11 @@ To create a snapshot using the Azure portal, complete these steps.
41
37
42
38
# [PowerShell](#tab/powershell)
43
39
44
-
Follow these steps to copy a VHD using PowerShell. This example assumes that you have a VM called *myVM* in the *myResourceGroup* resource group. The code sample provided will create a snapshot in the same resource group and within the same region as your source VM.
40
+
This example requires that you use [Cloud Shell](https://shell.azure.com/bash) or have the [Azure CLI](/cli/azure/) installed.
41
+
42
+
Follow these steps to take a snapshot with the `New-AzSnapshotConfig` and `New-AzSnapshot` cmdlets. This example assumes that you have a VM called *myVM* in the *myResourceGroup* resource group. The code sample provided creates a snapshot in the same resource group and within the same region as your source VM.
45
43
46
-
First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-azsnapshotconfig.cmd) cmdlet to create a configurable snapshot object. You can then use the [New-AzSnapshot](/powershell/module/az.compute/new-azsnapshot.cmd) cmdlet to take a snapshot of the disk.
44
+
First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-azsnapshotconfig) cmdlet to create a configurable snapshot object. You can then use the [New-AzSnapshot](/powershell/module/az.compute/new-azsnapshot) cmdlet to take a snapshot of the disk.
47
45
48
46
1. Set the required parameters. Update the values to reflect your environment.
49
47
@@ -54,7 +52,7 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
54
52
$snapshotName = 'mySnapshot'
55
53
```
56
54
57
-
1. Use the [Get-AzVM](/powershell/module/az.compute/get-azvm.md) cmdlet to get the VM containing the VHD you want to copy.
55
+
1. Use the [Get-AzVM](/powershell/module/az.compute/get-azvm) cmdlet to get the VM containing the VHD you want to copy.
58
56
59
57
```azurepowershell-interactive
60
58
$vm = Get-AzVM `
@@ -71,7 +69,7 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
71
69
-CreateOption copy
72
70
```
73
71
74
-
If you want to store your snapshot in zone-resilient storage, you must create the snapshot in a region that supports [availability zones](../availability-zones/az-overview.md) and include the `-SkuName Standard_ZRS` parameter. For a list of regions that support availability zones, see [Azure regions with availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones).
72
+
If you want to store your snapshot in zone-resilient storage, you must create the snapshot in a region that supports [availability zones](../availability-zones/az-overview) and include the `-SkuName Standard_ZRS` parameter. For a list of regions that support availability zones, see [Azure regions with availability zones](../availability-zones/az-region#azure-regions-with-availability-zones).
75
73
76
74
1. Take the snapshot.
77
75
@@ -82,17 +80,18 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
82
80
-ResourceGroupName $resourceGroupName
83
81
```
84
82
85
-
1. Use the [Get-AzSnapshot](/powershell/module/az.compute/get-azsnapshot.md) cmdlet to verify that your snapshot exists.
83
+
1. Use the [Get-AzSnapshot](/powershell/module/az.compute/get-azsnapshot) cmdlet to verify that your snapshot exists.
86
84
87
85
```azurepowershell-interactive
88
-
Get-AzSnapshot
86
+
Get-AzSnapshot `
87
+
-ResourceGroupName $resourceGroupName
89
88
```
90
89
91
90
# [Azure CLI](#tab/cli)
92
91
93
92
This example requires that you use [Cloud Shell](https://shell.azure.com/bash) or have the [Azure CLI](/cli/azure/) installed.
94
93
95
-
Use these steps to take a snapshot with the **az snapshot create** command and the **--source-disk** parameter. This example assumes that you have a VM called *myVM* in the *myResourceGroup* resource group. The code sample provided will create a snapshot in the same resource group and within the same region as your source VM.
94
+
Follow these steps to take a snapshot with the `az snapshot create` command and the `--source-disk` parameter. This example assumes that you have a VM called *myVM* in the *myResourceGroup* resource group. The code sample provided creates a snapshot in the same resource group and within the same region as your source VM.
96
95
97
96
1. Get the disk ID with [az vm show](/cli/azure/vm#az_vm_show).
98
97
@@ -113,8 +112,7 @@ Use these steps to take a snapshot with the **az snapshot create** command and t
113
112
--name osDisk-backup
114
113
```
115
114
116
-
> [!NOTE]
117
-
> If you would like to store your snapshot in zone-resilient storage, you need to create it in a region that supports [availability zones](../availability-zones/az-overview.md) and include the optional **--sku Standard_ZRS** parameter. A list of [availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones) can be found here.
115
+
If you would like to store your snapshot in zone-resilient storage, you need to create it in a region that supports [availability zones](../availability-zones/az-overview) and include the optional `--sku Standard_ZRS` parameter. A list of [availability zones](../availability-zones/az-region#azure-regions-with-availability-zones) can be found here.
118
116
119
117
1. Use [az snapshot list](/cli/azure/snapshot#az_snapshot_list) to verify that your snapshot exists.
120
118
@@ -132,14 +130,14 @@ Deploy a virtual machine from a snapshot. Create a managed disk from a snapshot
132
130
133
131
# [Portal](#tab/portal)
134
132
135
-
For more information, see the example in [Create a VM from a VHD by using the Azure portal](/azure/virtual-machines/windows/create-vm-specialized-portal.md).
133
+
For more information, see the example in [Create a VM from a VHD by using the Azure portal](windows/create-vm-specialized-portal).
136
134
137
135
# [PowerShell](#tab/powershell)
138
136
139
-
For more information, see the example in [Create a Windows VM from a specialized disk by using PowerShell](/azure/virtual-machines/windows/create-vm-specialized.md).
137
+
For more information, see the example in [Create a Windows VM from a specialized disk by using PowerShell](windows/create-vm-specialized).
140
138
141
139
# [Azure CLI](#tab/cli)
142
140
143
-
For more information, see the example in [Create a complete Linux virtual machine with the Azure CLI](/azure/virtual-machines/linux/create-cli-complete.md).
141
+
For more information, see the example in [Create a complete Linux virtual machine with the Azure CLI](/previous-versions/azure/virtual-machines/scripts/virtual-machines-linux-cli-sample-create-vm-from-snapshot?toc=%2fcli%2fmodule%2ftoc.json).
0 commit comments