Skip to content

Commit c478ab2

Browse files
authored
Merge pull request #225048 from roygara/otherFixes
Snapshot fixes
2 parents a907306 + 62c5a6e commit c478ab2

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

articles/virtual-machines/disks-incremental-snapshots.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ yourDiskID=$(az disk show -n $diskName -g $resourceGroupName --query "id" --outp
4040
az snapshot create -g $resourceGroupName -n $snapshotName --source $yourDiskID --incremental true
4141
```
4242

43+
> [!IMPORTANT]
44+
> After taking a snapshot of an Ultra Disk, you must wait for the snapshot to complete before you can use it. See the [Check status of snapshots or disks](#check-status-of-snapshots-or-disks) section for details.
45+
4346
You can identify incremental snapshots from the same disk with the `SourceResourceId` property of snapshots. `SourceResourceId` is the Azure Resource Manager resource ID of the parent disk.
4447

4548
You can use `SourceResourceId` to create a list of all snapshots associated with a particular disk. Replace `yourResourceGroupNameHere` with your value and then you can use the following example to list your existing incremental snapshots:
@@ -83,6 +86,9 @@ $snapshotConfig=New-AzSnapshotConfig -SourceUri $yourDisk.Id -Location $yourDisk
8386
New-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName -Snapshot $snapshotConfig
8487
```
8588

89+
> [!IMPORTANT]
90+
> After taking a snapshot of an Ultra Disk, you must wait for the snapshot to complete before you can use it. See the [Check status of snapshots or disks](#check-status-of-snapshots-or-disks) section for details.
91+
8692
You can identify incremental snapshots from the same disk with the `SourceResourceId` and the `SourceUniqueId` properties of snapshots. `SourceResourceId` is the Azure Resource Manager resource ID of the parent disk. `SourceUniqueId` is the value inherited from the `UniqueId` property of the disk. If you delete a disk and then create a new disk with the same name, the value of the `UniqueId` property changes.
8793

8894
You can use `SourceResourceId` and `SourceUniqueId` to create a list of all snapshots associated with a particular disk. Replace `yourResourceGroupNameHere` with your value and then you can use the following example to list your existing incremental snapshots:
@@ -107,9 +113,12 @@ $incrementalSnapshots
107113
# [Portal](#tab/azure-portal)
108114
[!INCLUDE [virtual-machines-disks-incremental-snapshots-portal](../../includes/virtual-machines-disks-incremental-snapshots-portal.md)]
109115

116+
> [!IMPORTANT]
117+
> After taking a snapshot of an Ultra Disk, you must wait for the snapshot to complete before you can use it. See the [Check status of snapshots or disks](#check-status-of-snapshots-or-disks) section for details.
118+
110119
# [Resource Manager Template](#tab/azure-resource-manager)
111120

112-
You can also use Azure Resource Manager templates to create an incremental snapshot. You'll need to make sure the apiVersion is set to **2019-03-01** and that the incremental property is also set to true. The following snippet is an example of how to create an incremental snapshot with Resource Manager templates:
121+
You can also use Azure Resource Manager templates to create an incremental snapshot. You'll need to make sure the apiVersion is set to **2022-03-22** and that the incremental property is also set to true. The following snippet is an example of how to create an incremental snapshot with Resource Manager templates:
113122

114123
```json
115124
{
@@ -130,7 +139,7 @@ You can also use Azure Resource Manager templates to create an incremental snaps
130139
"type": "Microsoft.Compute/snapshots",
131140
"name": "[concat( parameters('diskName'),'_snapshot1')]",
132141
"location": "[resourceGroup().location]",
133-
"apiVersion": "2019-03-01",
142+
"apiVersion": "2022-03-22",
134143
"properties": {
135144
"creationData": {
136145
"createOption": "Copy",
@@ -142,13 +151,16 @@ You can also use Azure Resource Manager templates to create an incremental snaps
142151
]
143152
}
144153
```
154+
> [!IMPORTANT]
155+
> After taking a snapshot of an Ultra Disk, you must wait for the snapshot to complete before you can use it. See the [Check status of snapshots or disks](#check-status-of-snapshots-or-disks) section for details.
156+
145157
---
146158

147-
## Check snapshot status
159+
## Check status of snapshots or disks
148160

149161
Incremental snapshots of Ultra Disks (preview) can't be used to create new disks until the background process copying the data into the snapshot has completed. Similarly, Ultra Disks created from incremental snapshots can't be attached to a VM until the background process copying the data into the disk has completed.
150162

151-
You can check the status of this copy process with the scripts in the following sections.
163+
You can use either the [CLI](#cli) or [PowerShell](#powershell) sections to check the status of the background copy from a disk to a snapshot and you can use the [Check disk creation status](#check-disk-creation-status) section to check the status of a background copy from a snapshot to a disk.
152164

153165
### CLI
154166

@@ -168,7 +180,7 @@ diskId=$(az disk show -n $diskName -g $resourceGroupName --query [id] -o tsv)
168180
az snapshot list --query "[?creationData.sourceResourceId=='$diskId' && incremental]" -g $resourceGroupName --output table
169181
```
170182

171-
Now that you have a list of snapshots, you can check the `CompletionPercent` property of a snapshot to get its status. Replace `$sourceSnapshotName` with the name of your snapshot. The value of the property must be 100 before you can use the snapshot for restoring disk or generate a SAS URI for downloading the underlying data.
183+
Now that you have a list of snapshots, you can check the `CompletionPercent` property of an individual snapshot to get its status. Replace `$sourceSnapshotName` with the name of your snapshot. The value of the property must be 100 before you can use the snapshot for restoring disk or generate a SAS URI for downloading the underlying data.
172184

173185
```azurecli
174186
az snapshot show -n $sourceSnapshotName -g $resourceGroupName --query [completionPercent] -o tsv
@@ -204,6 +216,33 @@ foreach ($snapshot in $snapshots)
204216
$incrementalSnapshots
205217
```
206218

219+
Now that you have a list of snapshots, you can check the `CompletionPercent` property of an individual snapshot to get its status. Replace `yourResourceGroupNameHere` and `yourSnapshotName` then run the script. The value of the property must be 100 before you can use the snapshot for restoring disk or generate a SAS URI for downloading the underlying data.
220+
221+
```azurepowershell
222+
$resourceGroupName = "yourResourceGroupNameHere"
223+
$snapshotName = "yourSnapshotName"
224+
225+
$targetSnapshot=Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
226+
227+
$targetSnapshot.CompletionPercent
228+
```
229+
230+
### Check disk creation status
231+
232+
When creating a disk from an Ultra Disk snapshot, you must wait for the background copy process to complete before you can attach it. Currently, you must use the Azure CLI to check the progress of the copy process.
233+
234+
The following script gives you the status of an individual disk's copy process. The value of `completionPercent` must be 100 before the disk can be attached.
235+
236+
```azurecli
237+
subscriptionId=yourSubscriptionID
238+
resourceGroupName=yourResourceGroupName
239+
diskName=yourDiskName
240+
241+
az account set --subscription $subscriptionId
242+
243+
az disk show -n $diskName -g $resourceGroupName --query [completionPercent] -o tsv
244+
```
245+
207246
## Check sector size
208247

209248
Snapshots with a 4096 logical sector size can only be used to create Ultra Disks. They can't be used to create other disk types. Snapshots of disks with 4096 logical sector size are stored as VHDX, whereas snapshots of disks with 512 logical sector size are stored as VHD. Snapshots inherit the logical sector size from the parent disk.
@@ -213,7 +252,7 @@ To determine whether or your Ultra Disk snapshot is a VHDX or a VHD, get the `Lo
213252
The following command displays the logical sector size of a snapshot:
214253

215254
```azurecli
216-
az snapshot show -g resourcegroupname-n snapshotname--query [creationData.logicalSectorSize] -o tsv
255+
az snapshot show -g resourcegroupname -n snapshotname --query [creationData.logicalSectorSize] -o tsv
217256
```
218257

219258
## Next steps

includes/virtual-machines-disks-incremental-snapshots-restrictions.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
author: roygara
66
ms.service: virtual-machines
77
ms.topic: include
8-
ms.date: 01/23/2023
8+
ms.date: 01/25/2023
99
ms.author: rogarana
1010
ms.custom: include file
1111
---
@@ -21,9 +21,11 @@
2121

2222
### Incremental snapshots of Ultra Disks (preview)
2323

24+
Incremental snapshots of Ultra Disks have the following extra restrictions:
25+
2426
- You must request and receive access to the preview from the following link: [https://aka.ms/UltraPremiumv2SnapshotPreview](https://aka.ms/UltraPremiumv2SnapshotPreview)
2527
- Currently only available in Sweden Central and US West 3.
26-
- Snapshots with a 4096 logical sector size can only be used to create Ultra Disks. They can't be used to create other disk types. To determine what sector size your snapshot has, see [check sector size](#check-sector-size).
27-
- When an incremental snapshot of an Ultra Disk is created, a background copy process for that disk is started. While a background copy is ongoing, you can have up to three total snapshots pending. The process must complete before any additional snapshots of that disk can be created.
28-
- Incremental snapshots of an Ultra disk can't be used immediately after they're created. The background copy must complete before you can create a disk from the snapshot. See [check snapshot status](#check-snapshot-status) for details.
29-
- Disks created from an incremental snapshot of an Ultra Disk can't be immediately attached to a VM once it's created. The background copy must complete before it can be attached. See [check snapshot status](#check-snapshot-status) for details.
28+
- Snapshots with a 512 logical sector size are stored as VHD, and can be used to create any disk type. Snapshots with a 4096 logical sector size are stored as VHDX and can only be used to create Ultra Disks, they can't be used to create other disk types. To determine which sector size your snapshot is, see [check sector size](#check-sector-size).
29+
- When an incremental snapshot of an Ultra Disk is created, a background copy process for that disk is started. While a background copy is ongoing, you can have up to three total snapshots pending. The process must complete before any more snapshots of that disk can be created.
30+
- Incremental snapshots of an Ultra disk can't be used immediately after they're created. The background copy must complete before you can create a disk from the snapshot. See [Check status of snapshots or disks](#check-status-of-snapshots-or-disks) for details.
31+
- Disks created from an incremental snapshot of an Ultra Disk can't be immediately attached to a VM once it's created. The background copy must complete before it can be attached. See [Check disk creation status](#check-disk-creation-status) for details.

0 commit comments

Comments
 (0)