Perform backup and restore operations by using Azure Backup Service
In this we will learn about how to back up a virtual machine in Azure and restore operations using Azure Backup Service. However, Azure backups can be created through the Azure portal. This method provides a browser-based user interface to create and configure Azure backups and all related resources. You can protect your data by taking backups at regular intervals. Azure Backup creates recovery points that can be stored in geo-redundant recovery vaults.
Select a VM to back up
Create a simple scheduled daily backup to a Recovery Services vault.
- Firstly, in the menu on the left, select Virtual machines.
- Secondly, from the list, choose a VM to back up. If you used the sample VM quickstart commands, the VM is named myVM in the myResourceGroup resource group.
- Lastly, in the Operations section, choose Backup. The Enable backup window opens.
Enable backup on a VM
A Recovery Services vault is a logical container that stores the backup data for each protected resource, such as Azure VMs. And, when the backup job for a protected resource runs, it creates a recovery point inside the Recovery Services vault. You can then use one of these recovery points to restore data to a given point in time.
- Firstly, select Create new and provide a name for the new vault, such as myRecoveryServicesVault.
- Secondly, if not already selected, choose Use existing, then select the resource group of your VM from the drop-down menu. However, by default, the vault is set for Geo-Redundant storage. Further, to protect your data, this storage redundancy level ensures that your backup data is replicated to a secondary Azure region that’s hundreds of miles away from the primary region.
- Lastly, to accept the default backup policy values, select Enable Backup.
Start a backup job
You can start a backup now rather than wait for the default policy to run the job at the scheduled time. This first backup job creates a full recovery point. Each backup job after this initial backup creates incremental recovery points. Incremental recovery points are storage and time-efficient, as they only transfer changes made since the last backup.
- Firstly, on the Backup window for your VM, select Backup now.
- Secondly, to accept the backup retention policy of 30 days, leave the default Retain Backup Till date. To start the job, select Backup.
Monitor the backup job
In the Backup window for your VM, the status of the backup and number of completed restore points are shown. Once the VM backup job is complete, information on the Last backup time, Latest restore point, and Oldest restore point is shown on the right-hand side of the Overview window.
Clean up deployment
When no longer needed, you can disable protection on the VM, remove the restore points and Recovery Services vault, then delete the resource group and associated VM resources
- Firstly, select the Backup option for your VM.
- Secondly, choose Stop backup.
- Thirdly, select Delete Backup Data from the drop-down menu.
- Then, in the Type the name of the Backup item dialog, enter your VM name, such as myVM. Select Stop Backup.
- And, once the VM backup has been stopped and recovery points removed, you can delete the resource group. If you used an existing VM, you may wish to leave the resource group and VM in place.
- In the menu on the left, select Resource groups.
- Next, from the list, choose your resource group. If you used the sample VM quickstart commands, the resource group is named myResourceGroup.
- Lastly, select Delete resource group. To confirm, enter the resource group name, then select Delete.
To restore a VM (create a new VM), make sure you have the correct Azure role-based access control (Azure RBAC) permissions for the Restore VM operation.
Select a restore point
- Firstly, in the vault associated with the VM you want to restore, select Backup items > Azure Virtual Machine.
- Then, select a VM. By default on the VM dashboard, recovery points from the last 30 days are displayed.
- Thirdly, to restore the VM, select Restore VM.
- Lasltly, select a restore point to use for the recovery.
Create a VM
As one of the restore options, you can create a VM quickly with basic settings from a restore point.
- Firstly, in Restore Virtual Machine > Create new > Restore Type, select Create a virtual machine.
- Secondly, in Virtual machine name, specify a VM that doesn’t exist in the subscription.
- Then, in Resource group, select an existing resource group for the new VM, or create a new one with a globally unique name. If you assign a name that already exists, Azure assigns the group the same name as the VM.
- After that, in Virtual network, select the VNet in which the VM will be placed. All VNets associated with the subscription are displayed. Select the subnet. The first subnet is selected by default.
- Next, in Staging Location, specify the storage account for the VM. Learn more.
- Lastly, select Restore to trigger the restore operation.
Replace existing disks
As one of the restore options, you can replace an existing VM disk with the selected restore point. Review all restore options.
- Firstly, in Restore configuration, select Replace existing.
- Secondly, in Restore Type, select Replace disk/s. This is the restore point that will be used replace existing VM disks.
- Lastly, in Staging Location, specify where snapshots of the current managed disks should be saved during the restore process. Learn more.
Post-restore steps
There are a number of things to note after restoring a VM:
- Firstly, extensions present during the backup configuration are installed, but not enabled. If you see an issue, reinstall the extensions.
- Secondly, if the backed-up VM had a static IP address, the restored VM will have a dynamic IP address to avoid conflict. You can add a static IP address to the restored VM.
- Thirdly, a restored VM doesn’t have an availability set. If you use the restore disk option, then you can specify an availability set when you create a VM from the disk using the provided template or PowerShell.
- Next, if you use a cloud-init-based Linux distribution, such as Ubuntu, for security reasons the password is blocked after the restore. Use the VMAccess extension on the restored VM to reset the password. We recommend using SSH keys on these distributions, so you don’t need to reset the password after the restore.
- And, if you’re unable to access a VM once restored because the VM has a broken relationship with the domain controller, then follow the steps below to bring up the VM:
- Attach OS disk as a data disk to a recovered VM.
- Manually install VM agent if Azure Agent is found to be unresponsive by following this link.
- Enable Serial Console access on VM to allow command-line access to VM
- Lastly, once the VM is disjoined and restarted, you’ll be able to successfully RDP to the VM with local admin credentials and rejoin VM back to domain successfully.
Reference: Microsoft Documentation, Documentation 2