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
+30-13Lines changed: 30 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,11 @@ ms.date: 08/20/2021
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 take a snapshot of a VHD to use as a backup, or to 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 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.
18
18
19
-
If you want to use a snapshot to create a new VM, we recommend that you first cleanly shut down the VM. This action clears any processes that are in progress.
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.
20
+
21
+
## Create a snapshot of a virtual hard drive
20
22
21
23
# [Portal](#tab/portal)
22
24
@@ -29,16 +31,17 @@ To create a snapshot using the Azure portal, complete these steps.
29
31
1. Enter a **Name**, then select a **Region** and **Snapshot type** for the new snapshot.
30
32
31
33
> [!NOTE]
32
-
> 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). You are not able to utilize zone-redundant storage in a region that does not support availability zones. A list of [availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones) can be found [here](../availability-zones/az-region.md#azure-regions-with-availability-zones).
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 regionswithavailability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones).
33
35
34
36
1. For **Source subscription**, select the subscription that contains the managed disk to be backed up.
35
37
1. For **Source disk**, select the managed disk to snapshot.
36
38
1. For **Storage type**, select **Standard HDD**, unless you require zone-redundant storage or high-performance storage for your snapshot.
37
-
1. Select **Review** and **Create**.
39
+
1. If needed, configure settings on the **Encryption**, **Networking**, and **Tags** tabs. Otherwise, default settings will be used for your snapshot.
40
+
1. Select **Review + create**.
38
41
39
42
# [PowerShell](#tab/powershell)
40
43
41
-
Follow these steps to copy a VHD using PowerShell. This example assumes that your snapshot will be stored in the same resource group and within the same region as your source VM.
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.
42
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
47
@@ -51,15 +54,15 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
51
54
$snapshotName = 'mySnapshot'
52
55
```
53
56
54
-
1. Use the [Get-AzVM](/powershell/module/az.compute/get-azvm.md?view=azps-6.3.0&preserve-view=true) cmdlet to get the VM containing the VHD you want to copy.
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
58
56
59
```azurepowershell-interactive
57
60
$vm = Get-AzVM `
58
61
-ResourceGroupName $resourceGroupName `
59
62
-Name $vmName
60
63
```
61
64
62
-
1. Create the snapshot configuration. In this example, the snapshot is of the OS disk.
65
+
1. Create the snapshot configuration. In the example, the snapshot is of the OS disk. By default, the snapshot uses locally redundant standard storage. We recommend that you store your snapshots in standard storage instead of premium storage whatever the storage type of the parent disk or target disk. Premium snapshots incur additional cost.
63
66
64
67
```azurepowershell-interactive
65
68
$snapshot = New-AzSnapshotConfig `
@@ -69,7 +72,7 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
69
72
```
70
73
71
74
> [!NOTE]
72
-
> If you would like to store your snapshot in zone-resilient storage, create it in a region that supports [availability zones](../availability-zones/az-overview.md) and include the `-SkuName Standard_ZRS` parameter. A list of [availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones) can be found here.
75
+
> 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).
73
76
74
77
1. Take the snapshot.
75
78
@@ -80,7 +83,7 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
80
83
-ResourceGroupName $resourceGroupName
81
84
```
82
85
83
-
1. Use the [Get-AzSnapshot](/powershell/module/az.compute/get-azsnapshot.md?view=azps-6.3.0&preserve-view=true) cmdlet to verify that your snapshot exists.
86
+
1. Use the [Get-AzSnapshot](/powershell/module/az.compute/get-azsnapshot.md) cmdlet to verify that your snapshot exists.
84
87
85
88
```azurepowershell-interactive
86
89
Get-AzSnapshot
@@ -90,7 +93,7 @@ First, you'll use the [New-AzSnapshotConfig](/powershell/module/az.compute/new-a
90
93
91
94
This example requires that you use [Cloud Shell](https://shell.azure.com/bash) or have the [Azure CLI][/cli/azure/] installed.
92
95
93
-
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.
96
+
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
97
95
98
1. Get the disk ID with [az vm show](/cli/azure/vm#az_vm_show).
96
99
@@ -102,7 +105,7 @@ Use these steps to take a snapshot with the **az snapshot create** command and t
102
105
-o tsv)
103
106
```
104
107
105
-
1. Take a snapshot named *osDisk-backup* using [az snapshot create](/cli/azure/snapshot#az_snapshot_create).
108
+
1. Take a snapshot named *osDisk-backup* using [az snapshot create](/cli/azure/snapshot#az_snapshot_create). In the example, the snapshot is of the OS disk. By default, the snapshot uses locally redundant standard storage. We recommend that you store your snapshots in standard storage instead of premium storage whatever the storage type of the parent disk or target disk. Premium snapshots incur additional cost.
106
109
107
110
```azurecli-interactive
108
111
az snapshot create \
@@ -112,7 +115,7 @@ Use these steps to take a snapshot with the **az snapshot create** command and t
112
115
```
113
116
114
117
> [!NOTE]
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.md) and include the **--sku Standard_ZRS** parameter. A list of [availability zones](../availability-zones/az-region.md#azure-regions-with-availability-zones) can be found here.
118
+
> 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.
116
119
117
120
1. Use [az snapshot list](/cli/azure/snapshot#az_snapshot_list) to verify that your snapshot exists.
118
121
@@ -126,4 +129,18 @@ Use these steps to take a snapshot with the **az snapshot create** command and t
126
129
127
130
## Next steps
128
131
129
-
Deploy a virtual machine from a snapshot. Create a managed disk from a snapshot and then attach the new managed disk as the OS disk. For more information, see the example in [Create a VM from a snapshot with PowerShell](/previous-versions/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-create-vm-from-snapshot).
132
+
Deploy a virtual machine from a snapshot. Create a managed disk from a snapshot and then attach the new managed disk as the OS disk.
133
+
134
+
# [Portal](#tab/portal)
135
+
136
+
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).
137
+
138
+
# [PowerShell](#tab/powershell)
139
+
140
+
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).
141
+
142
+
# [Azure CLI](#tab/cli)
143
+
144
+
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).
0 commit comments