Create an incremental snapshot for managed disks
Applies to: ✔️ Linux VMs ✔️ Windows VMs ✔️ Flexible scale sets ✔️ Uniform scale sets
Incremental snapshots are point in time backups for managed disks that, when taken, consist only of the changes since the last snapshot. When you restore a disk from an incremental snapshot, the system reconstruct the full disk which represents the point in time backup of the disk when the incremental snapshot was taken. This capability for managed disk snapshots potentially allows them to be more cost effective, since, unless you choose to, you do not have to store the entire disk with each individual snapshot. Just like full snapshots, incremental snapshots can be used to either create a full managed disk or a full snapshot. Both full snapshots and incremental snapshots can be used immediately after being taken. In other words, once you take either snapshot, you can immediately read the underlying VHD and use it to restore disks.
There are a few differences between an incremental snapshot and a full snapshot. Incremental snapshots will always use standard HDDs storage, irrespective of the storage type of the disk, whereas full snapshots can use premium SSDs. If you are using full snapshots on Premium Storage to scale up VM deployments, we recommend you use custom images on standard storage in the Shared Image Gallery. It will help you achieve a more massive scale with lower cost. Additionally, incremental snapshots potentially offer better reliability with zone-redundant storage (ZRS). If ZRS is available in the selected region, an incremental snapshot will use ZRS automatically. If ZRS is not available in the region, then the snapshot will default to locally-redundant storage (LRS). You can override this behavior and select one manually but, we do not recommend that.
Incremental snapshots also offer a differential capability, only available to managed disks. They enable you to get the changes between two incremental snapshots of the same managed disks, down to the block level. You can use this capability to reduce your data footprint when copying snapshots across regions. For example, you can download the first incremental snapshot as a base blob in another region. For the subsequent incremental snapshots, you can copy only the changes since the last snapshot to the base blob. After copying the changes, you can take snapshots on the base blob that represent your point in time backup of the disk in another region. You can restore your disk either from the base blob or from a snapshot on the base blob in another region.
Incremental snapshots are billed for the used size only. You can find the used size of your snapshots by looking at the Azure usage report. For example, if the used data size of a snapshot is 10 GiB, the daily usage report will show 10 GiB/(31 days) = 0.3226 as the consumed quantity.
- Incremental snapshots currently cannot be moved between subscriptions.
- You can currently only generate SAS URIs of up to five snapshots of a particular snapshot family at any given time.
- You cannot create an incremental snapshot for a particular disk outside of that disk's subscription.
- Up to seven incremental snapshots per disk can be created every five minutes.
- A total of 200 incremental snapshots can be created for a single disk.
- You cannot get the changes between snapshots taken before and after you changed the size of the parent disk across 4 TB boundary. For example, You took an incremental snapshot snapshot-a when the size of a disk was 2 TB. Now you increased the size of the disk to 6 TB and then took another incremental snapshot snapshot-b. You cannot get the changes between snapshot-a and snapshot-b. You have to again download the full copy of snapshot-b created after the resize. Subsequently, you can get the changes between snapshot-b and snapshots created after snapshot-b.
The following script will create an incremental snapshot of a particular disk:
# Declare variables diskName="yourDiskNameHere" resourceGroupName="yourResourceGroupNameHere" snapshotName="desiredSnapshotNameHere" # Get the disk you need to backup yourDiskID=$(az disk show -n $diskName -g $resourceGroupName --query "id" --output tsv) # Create the snapshot az snapshot create -g $resourceGroupName -n $snapshotName --source $yourDiskID --incremental true
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.
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:
# Declare variables and create snapshot list subscriptionId="yourSubscriptionId" resourceGroupName="yourResourceGroupNameHere" diskName="yourDiskNameHere" az account set --subscription $subscriptionId diskId=$(az disk show -n $diskName -g $resourceGroupName --query [id] -o tsv) az snapshot list --query "[?creationData.sourceResourceId=='$diskId' && incremental]" -g $resourceGroupName --output table
If you'd like to see sample code demonstrating the differential capability of incremental snapshots, using .NET, see Copy Azure Managed Disks backups to another region with differential capability of incremental snapshots.