Training
Module
Add and size disks in Azure virtual machines - Training
Learn about your virtual machine storage options and how to choose between standard and premium, managed and unmanaged disks for your Azure virtual machine.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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. The first incremental snapshot is a full copy of the disk. The subsequent incremental snapshots occupy only delta changes to disks since the last snapshot. When you restore a disk from an incremental snapshot, the system reconstructs the full disk that 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 don't 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 data 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 HDD storage, irrespective of the storage type of the disk, whereas full snapshots can use premium SSDs. If you're using full snapshots on Premium Storage to scale up VM deployments, we recommend you use custom images on standard storage in the Azure Compute 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 isn't 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 don't recommend that.
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.
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 can't get the changes between snapshot-a
and snapshot-b
. You have to 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
.Incremental snapshots of Premium SSD v2 and Ultra Disks have the following extra restrictions:
Note
Normally, when you take an incremental snapshot, and there aren't any changes, the size of that snapshot is 0 MiB. Currently, empty snapshots of disks with a 4096 logical sector size instead have a size of 6 MiB, when they'd normally be 0 MiB.
You can use the Azure PowerShell module to create an incremental snapshot. You need the latest version of the Azure PowerShell module. The following command will either install it or update your existing installation to latest:
Install-Module -Name Az -AllowClobber -Scope CurrentUser
Once that is installed, sign in to your PowerShell session with Connect-AzAccount
.
To create an incremental snapshot with Azure PowerShell, set the configuration with New-AzSnapShotConfig with the -Incremental
parameter and then pass that as a variable to New-AzSnapshot through the -Snapshot
parameter.
$diskName = "yourDiskNameHere"
$resourceGroupName = "yourResourceGroupNameHere"
$snapshotName = "yourDesiredSnapshotNameHere"
# Get the disk that you need to backup by creating an incremental snapshot
$yourDisk = Get-AzDisk -DiskName $diskName -ResourceGroupName $resourceGroupName
# Create an incremental snapshot by setting the SourceUri property with the value of the Id property of the disk
$snapshotConfig=New-AzSnapshotConfig -SourceUri $yourDisk.Id -Location $yourDisk.Location -CreateOption Copy -Incremental
New-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName -Snapshot $snapshotConfig
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.
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:
$resourceGroupName = "yourResourceGroupNameHere"
$snapshots = Get-AzSnapshot -ResourceGroupName $resourceGroupName
$incrementalSnapshots = New-Object System.Collections.ArrayList
foreach ($snapshot in $snapshots)
{
if($snapshot.Incremental -and $snapshot.CreationData.SourceResourceId -eq $yourDisk.Id -and $snapshot.CreationData.SourceUniqueId -eq $yourDisk.UniqueId){
$incrementalSnapshots.Add($snapshot)
}
}
$incrementalSnapshots
Incremental snapshots of Premium SSD v2 or Ultra Disks can't be used to create new disks until the background process copying the data into the snapshot has completed.
You can use either the CLI or PowerShell sections to check the status of the background copy from a disk to a snapshot.
Important
You can't use the following sections to get the status of the background copy process for disk types other than Ultra Disk or Premium SSD v2. Snapshots of other disk types always report 100%.
You have two options for getting the status of snapshots. You can either get a list of all incremental snapshots associated with a specific disk, and their respective status, or you can get the status of an individual snapshot.
The following script returns a list of all snapshots associated with a particular disk. The value of the CompletionPercent
property of any snapshot must be 100 before it can be used. Replace yourResourceGroupNameHere
, yourSubscriptionId
, and yourDiskNameHere
with your values then run the script:
# 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
You can also check the status of an individual snapshot by checking the CompletionPercent
property. Replace $sourceSnapshotName
with the name of your snapshot then run the following command. 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.
az snapshot show -n $sourceSnapshotName -g $resourceGroupName --query [completionPercent] -o tsv
You have two options for getting the status of snapshots. You can either get a list of all incremental snapshots associated with a particular disk and their respective status, or you can get the status of an individual snapshot.
The following script returns a list of all incremental snapshots associated with a particular disk that haven't completed their background copy. Replace yourResourceGroupNameHere
and yourDiskNameHere
, then run the script.
$resourceGroupName = "yourResourceGroupNameHere"
$snapshots = Get-AzSnapshot -ResourceGroupName $resourceGroupName
$diskName = "yourDiskNameHere"
$yourDisk = Get-AzDisk -DiskName $diskName -ResourceGroupName $resourceGroupName
$incrementalSnapshots = New-Object System.Collections.ArrayList
foreach ($snapshot in $snapshots)
{
if($snapshot.Incremental -and $snapshot.CreationData.SourceResourceId -eq $yourDisk.Id -and $snapshot.CreationData.SourceUniqueId -eq $yourDisk.UniqueId)
{
$targetSnapshot=Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
{
if($targetSnapshot.CompletionPercent -lt 100)
{
$incrementalSnapshots.Add($targetSnapshot)
}
}
}
}
$incrementalSnapshots
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.
$resourceGroupName = "yourResourceGroupNameHere"
$snapshotName = "yourSnapshotName"
$targetSnapshot=Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
$targetSnapshot.CompletionPercent
Snapshots with a 4096 logical sector size can only be used to create Premium SSD v2 or 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.
To determine whether or your Premium SSD v2 or Ultra Disk snapshot is a VHDX or a VHD, get the LogicalSectorSize
property of the snapshot.
The following command displays the logical sector size of a snapshot:
az snapshot show -g resourcegroupname -n snapshotname --query [creationData.logicalSectorSize] -o tsv
See the following articles to create disks from your snapshots using the Azure CLI or Azure PowerShell module.
See Copy an incremental snapshot to a new region to learn how to copy an incremental snapshot across regions.
If you have more questions on snapshots, see the snapshots section of the FAQ.
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.
Training
Module
Add and size disks in Azure virtual machines - Training
Learn about your virtual machine storage options and how to choose between standard and premium, managed and unmanaged disks for your Azure virtual machine.
Documentation
Backup and disaster recovery for managed disks on Azure VMs - Azure Virtual Machines
This article explains how to plan for backup and disaster recovery of IaaS virtual machines and managed disks in Azure.
Create an Azure snapshot of a virtual hard disk - Azure Virtual Machines
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.
Copy a snapshot to a new region - Azure Virtual Machines
Learn how to copy an incremental snapshot of a managed disk to a different region.