Murrstock - stock.adobe.com

How to create an incremental snapshot in Azure

Incremental snapshots provide several advantages over full snapshots, including lower cost and faster backups. Learn how to create an incremental snapshot in Azure.

Imagine editing a picture. You want to fix the light balance and then add a filter. If you decide the filter isn't right, you can undo that change and go back to the version of the photo with just the light balance. Perhaps you make dozens of changes and then you decide to start over and revert to the original. This is comparable to creating an incremental snapshot versus a full snapshot.

Using incremental snapshots instead of full snapshots for Azure VMs can save a lot of time and disk space. Read up on tips for when it makes sense to take advantage of incremental snapshots in Azure as well as an overview of the incremental snapshot process.

What are incremental snapshots in Azure?

In Azure, an incremental snapshot is a point-in-time backup for a managed disk. When you create an incremental snapshot, you create a backup resource. This resource records only the changes that have been made to the disk since the most recent previous backup.

If you have at least one previous full snapshot of your disk, you can restore a complete managed disk. To do this, you'd perform a partial restore based on the most recent complete backup. Then you'd apply any changes recorded in the incremental backup to restore the disk to its state at the time of the incremental snapshot.

There's no way to create incremental snapshots without first having created at least one full snapshot. If you have never performed a full snapshot, any incremental snapshot that you'd attempt to create would end up being a full snapshot. This is because there would not be any previous point in time for Azure to reference to create an incremental snapshot.

Benefits of incremental snapshots

There are two main reasons to use incremental snapshots when backing up Azure managed disks:

  • Faster backups. Because incremental snapshots only record whichever changes have taken place since the last backup, there is less data that needs to be written. This results in faster backups.
  • Lower costs While there is no difference in price for creating full vs incremental snapshots, incremental snapshots can save money because they lead to smaller backup files. That translates into less data stored in Azure and reduced data egress when transferring backups, both of which can help reduce your cloud computing bill.

The more changes your managed disk has experienced since the last incremental or full snapshots, the smaller the benefits you'll reap by using incremental snapshots. If a lot of data has changed on the disk, the incremental backup will require a lot of data copying and storage.

Incremental backups are typically most beneficial for VMs with contents that don't change frequently.

Incremental backups are typically most beneficial for VMs with contents that don't change frequently. For example, VMs that hosts a stateless application -- meaning one that doesn't use persistent storage -- or apps with storage external to the VM are good candidates for incremental snapshots. This is because the app is not likely to introduce large changes to the VM once it is up and running.

In contrast, apps that constantly write or modify data on a managed disk is harder to back up efficiently using incremental snapshots because there will be so many changes to register with each backup.

Full vs. incremental Azure snapshots

Incremental snapshots are the opposite of full snapshots. With full snapshots, you create a complete copy of the entire managed disk every time you back it up. Both methods achieve the same goal -- restoring managed disks when necessary -- in most cases, but they work in somewhat different ways:

  • Storage. Incremental snapshots use HDD storage. Full snapshots have the option of using premium SSD storage, which may lead to faster performance.
  • Reliability. In Azure cloud regions where zone-redundant storage is available, incremental snapshots will use it. This leads to potentially better reliability.
  • Cost. With incremental snapshots, you pay for the actual storage space consumed by your backups rather than the size of the managed disk. For example, if your managed disk is 50 gigabytes but your incremental snapshot takes up only 5 gigabytes of space, you pay for only 5 gigabytes. With full snapshots, your backup will be about as large as the disk, so that's a cost to factor into your decision.

Incremental snapshots make sense in use cases where high-performance storage is not a priority but you care about increasing the reliability of your backups and saving money.

How to create an incremental snapshot on Azure

You can create incremental snapshots in two ways: Using the Azure Portal or the CLI.

To use the Azure Portal, log in and navigate to the managed disk you'd like to back up. Then click the Create snapshot button and configure the snapshot. Be sure to select the Incremental snapshot option.

Create an incremental snapshot
Choose the right snapshot type.

When you're done, press Create to generate the snapshot.

To create an incremental snapshot using the Azure CLI, first log in to your environment with the az login command.

Next, create an incremental backup policy.

az backup policy create --name [POLICY_NAME] --resource-group [RESOURCE_GROUP_NAME] --backup-management-type AzureIaasVM --incremental-backup-frequency-in-minutes [TIME]

Finally, generate the incremental snapshot.

az backup protection enable-for-vm --policy-name [POLICY_NAME] --resource-group [RESOURCE_GROUP_NAME] --vm-name [VM_NAME] --disk-name [DISK_NAME]

For full details on Azure incremental snapshot options, refer to the Azure backup documentation.

Dig Deeper on Cloud provider platforms and tools