The Talent500 Blog
VM

Azure VM Backup

INTRODUCTION

Azure Backup is a cloud-based backup service that provides data protection capabilities for diverse and mission-critical workloads in a simple and cost-effective way. It allows you to back up and restore VMs, files, folders, system state, on-premises workloads, or even an SQL database. In this blog post, we will provide a comprehensive overview of Azure Backup, including its features, use cases, and benefits.

The Azure Backup service lets you conveniently back up entire Virtual Machines (VMs) on Azure, and restore them with three levels of consistency — app-consistent, file-consistent, and crash-consistent. Read on to understand how Azure backs up entire VMs, and see quick instructions for setting up a Recovery Services vault and using it to backup multiple Windows or Linux VMs.

Features of Azure Backup

Azure Backup provides a wide range of features that can be used for various applications. Some of the key features of Azure Backup are:

  • Application Consistent Backup: Azure Backup offers application-consistent backup of Linux and Windows virtual machines in Azure to safeguard against unintended destruction of data in your virtual machines.
  • Automated Backup: Azure Backup allows you to automate the backup process and schedule backups to occur at regular intervals.
  • Selective Disk Backup: Azure Backup allows you to exclude or include certain data disks in the virtual machine (VM) from being protected using the selective disk backup feature.
  • Vaulted Backup: Azure Backup provides a managed offsite data protection solution to get protection against any accidental or malicious deletion of blobs or storage account.
  • Centralized management: Azure Backup provides a centralized management interface to manage and monitor your entire backup estate from a central console with Backup center.
  • Scalability: Azure Backup is scalable based on your backup storage needs and provides automatic scaling and resource allocation based on container requirements
  • Security: Azure Backup provides secure transfer of backups to Azure Backup storage with private endpoints and ensures availability with zone- and geo-redundant storage and the ability to restore backups from a paired region at any time.

What is Azure VM Backup?

The Azure Backup service lets you schedule backups for entire Virtual Machines (VMs). VM backup works differently for Windows and Linux VMs:

  • Windows VMs— Windows VSS is used to take a snapshot which is application consistent. This is a snapshot that captures files, memory, and upcoming I/O operations. This means when a VM is restored, there is no data corruption and apps start in a consistent state.
  • Linux VMs— for Linux, Azure backup takes a snapshot that is consistent at the file level. This ensures no data corruption, but cannot guarantee applications will remain consistent. Apps should ensure that transactions were not interrupted, etc.

You can get app-consistent snapshots in Linux as well, by providing pre and post-launch scripts.
Please note that if you make use of Azure File Storage, your Azure Files shares will not be backed up together with your VM. You should set up backup for Azure Files separately in the Azure Portal.

Use Cases for Azure Backup

Azure Backup can be used for a wide range of applications, from backing up virtual machines to protecting data stored in Azure Blob. Some of the key use cases for Azure Backup are:

  • Virtual Machine Backup: Azure Backup can be used to back up and restore VMs (Hyper-V and VMWare), files, folders, system state, on-premises workloads, or even an SQL database.
  • Blob Backup: Azure Backup provides a simple, secure, cost-effective, and cloud-based backup solution to protect your business or application-critical data stored in Azure Blob.
  • Selective Disk Backup: Azure Backup allows you to exclude or include certain data disks in the virtual machine (VM) from being protected using the selective disk backup feature.

Benefits of Azure Backup

Azure Backup provides a wide range of benefits, including:

Scalability: Azure Backup is a cloud-based service that can scale to meet the needs of any application, from small-scale projects to large-scale enterprise applications.

Cost-Effective: Azure Backup is a cost-effective solution that allows you to pay only for the backups you need.

Ease of Use: Azure Backup is easy to use, with a simple interface that can be integrated into any application.

Automated Backup: Azure Backup allows you to automate the backup process and schedule backups to occur at regular intervals.

Important Considerations Before Backing Up VMs

Take the following considerations into account when planning your backups:

  • Snapshot consistency— for app-consistent or file-consistent snapshots to work, ensure that VMs are running when backups take place.
  • Spread out VM backups— do not schedule all VMs to back up at the same time of day, because this will clog up bandwidth used to transfer snapshot data to the vault. Separate each group of VMs to backup at a different time.
  • Time for backup preparation— it takes up to 8 hours for Azure backup to prepare a backup, by installing a backup extension, identifying incremental changes and creating a local snapshot.
  • Time for backup transfer— it can take a few hours to transfer the latest snapshot data to the vault. Azure guarantees it will not take more than 24 hours for scheduled daily backups (except for the first backup of a VM).
  • Time for restore— the time to restore a backup depends on the number of IOPS and throughput of the storage account. For restore operations, prefer a storage account that is not currently overloaded with data requests.
  • Fragmentation and churn— hard disks that have undergone defragmentation, and that have daily churn of less than 200 GB, can be prepared for backup faster by Azure Backup. Daily churn of over 200 GB may result in backup preparation taking more than eight hours.

How Azure VM Backup Works

VM backup follows this process:

  1. You set up a Recovery Services vault — this is a storage entity that can hold backup policies and schedules, as well as actual copies of backup data. 
  2. You associate the vault with one or more Azure VMs. You can do this in the vault backup policy configuration, or by modifying backup settings for each individual VM. 
  3. Each Azure VM has an Azure VM agent, which has a backup extension installed. In most cases this agent is installed by default on the VM, otherwise it is installed automatically during the first backup. 
  4. The VM agent checks the VM’s backup policy, and when it is time for a backup, creates a snapshot and stores it on VM local storage. To make the process faster, it backs up several disks at the same time, and performs incremental backup (only saving changes since the previous backup). 
  5. The snapshot is then transferred to the vault, and when it finishes transferring, it is removed from local storage, and Azure Backup creates a recovery point.

 Azure VM Backup Encryption

Cloud security best practices promote encryption of sensitive data, both at rest and in transit. Azure Backup provides two options for encrypting data:

  • Backing up VMs already encrypted using Azure Disk Encryption— data can be decrypted using BitLocker encryption keys (BEKs), or BEKs combined with Key Vault Key encryption keys (KEKs).
  • Backing up unencrypted VMs — for VMs that do not have pre-existing encryption, you can use Storage Service Encryption (SSE) to encrypt backup data at rest. It automatically manages keys and decrypts data before restoring it.

How to Backup Multiple VMs to a Recovery Services Vault: Step by Step

Here is the general process for backing up multiple VMs to a vault — a storage unit managed by the Azure Backup service, which also holds your backup policies.

  1. Create a vault

In the Azure portal, select Recovery Services, click vaults, and add a vault. Name your vault and select a region, resource group, and Azure subscription.

Check status notifications in the top-right area to see vault creation status and when the process is complete.

  1. Select replication type

Once your vault is created, you can select a replication option. You must do this when the vault is new and does not have VMs or backups associated with it yet.

Access the vault and click Settings > Properties > Backup Configuration > Update. You can use Geo-redundant storage (GRS) or Locally-redundant storage (LRS), which costs less but is not as reliable.

  1. Configure a backup policy and select VMs

Access the vault and click+Backup. Select that your workload is running in Azure and what you want to back up is Virtual Machine.

You can select a default backup policy, which backs up VMs once a day and retains backup for 30 days, with instant recovery snapshots kept for two days. If you want to define your own custom policy, select Create New, and define your options.

Next, click Select virtual machines. Each VM can be connected to one vault, and both VM and vault must be in the same region.

  1. Deploy the backup

Click Enable backup to deploy the backup policy. This will also:

  • Install the backup extension on all the VM agents.
  • Run an initial backup.
  • View Backup job status

In your vault, click Backup Jobs to see the status of active backup jobs. For each backup job, you can view Sub-Tasks, to see which step the backup job has completed — creating a snapshot or transferring data to the vault.

Once a snapshot has been created, it means there is a local copy that can enable instant recovery of the VM. Once data has been transferred to the vault, it means that there is a recovery point is set in the vault, enabling long-term recovery.
A backup job can have one of the following statuses:

  • Completed — both snapshot and vault recovery point successfully created
  • In progress — snapshot created, vault data transfer in progress
  • Completed with warning — snapshot created, vault data recovery point was not
  • Failed — neither snapshot nor recovery point was created.

Third-Party Solutions

While Azure Backup provides a comprehensive backup solution, there are also third-party solutions available that can provide additional features and capabilities. These solutions can be used to enhance the backup and recovery capabilities of Azure Backup, or to provide additional backup and recovery options for workloads that are not supported by Azure Backup.

Estimate and Calculate Your Azure Backup Costs

Before estimating your actual Azure Backup costs, it is essential to understand the Azure Backup pricing model and how pricing is calculated. The following factors are considered when calculating Azure Backup costs:

  • The size of the data being backed up
  • The frequency of backups
  • The retention period of backups
  • The storage redundancy option chosen

Use Azure Backup Storage Reserved Capacity

You can save money on backup storage costs for the vault-standard tier using Azure Backup Storage reserved capacity. Azure Backup Storage reserved capacity can significantly reduce your capacity costs for Azure Backup data. The cost savings achieved depend on the duration of your reservation, the total capacity you choose to reserve, and the vault tier and type of redundancy you’ve chosen for your vault.

Clean Up Unnecessary Backups

One way you can optimize your Azure Backup costs is by cleaning up backups for resources that are no longer needed or do not exist anymore. This can help you save costs by reducing the amount of storage space required for backups. By following these tips, you can optimize your Azure Backup costs and ensure that you are not overspending on backup and recovery capabilities.

Conclusion

Azure Backup is a powerful tool that can be used for a wide range of applications, from backing up virtual machines to protecting data stored in Azure Blob. Its features, use cases, and benefits make it an attractive option for businesses and developers looking to add backup and recovery capabilities to their applications. With its scalability, cost-effectiveness, ease of use, and automated backup capabilities, Azure Backup is a valuable tool for any application that requires backup and recovery capabilities.

In this article, I explained how to backup up virtual machines on Azure. Azure supports the following backup options for Vms:

Backup for Windows and Azure VMs, with file-consistent or app consistent snapshots

  • Automated agent-based backup process
  • Encryption of backup data both at rest and in transit
  • Easy backup management via the Azure portal
0
Avatar

Priyam Vaidya

A certified cloud architect (Azure and AWS) with over 15 years of experience in IT. Currently working as Sr Cloud Infrastructure Engineer. Love to explore and train others on new technology

Add comment