How do I restore a VM in Azure?

There are multiple options for restoring a virtual machine in Azure.

Restore option

Details

Create a new VM

Quickly creates and gets a basic VM up and running from a restore point.

You can specify a name for the VM, select the resource group and virtual network (VNet) in which it will be placed, and specify a storage account for the restored VM.

Restore disk

Restores a VM disk which can then be used to create a new VM.

Azure Backup provides a template to help you customize and create a VM.

The restore job generates a template that you can download and use to specify custom VM settings, and create a VM.

The disks are copied to the storage account you specify.

Alternatively, you can attach the disk to an existing VM, or create a new VM using PowerShell.

This option is useful if you want to customize the VM, add configuration settings that weren't there at the time of backup, or add settings that must be configured using the template or PowerShell.

Replace existing

You can restore a disk and use it to replace a disk on the existing VM.

The current VM must exist. If it's been deleted this option can't be used.

Azure Backup takes a snapshot of the existing VM before replacing the disk and stores it in the staging location you specify. Existing disks connected to the VM are replaced with the selected restore point.

The snapshot is copied to the vault and retained in accordance with the retention policy.

Replace existing is supported for unencrypted managed VMs. It's not supported for unmanaged disks, generalized VMs, or for VMs created using custom images.

If the restore point has more or less disks than the current VM, then the number of disks in the restore point will only reflect the VM configuration.

Note: You can also recover specific files and folders on an Azure VM.

If you're running the latest version of Azure Backup for Azure VMs (known as Instant Restore), snapshots are kept for up to seven days, and you can restore a VM from snapshots before the backup data is sent to the vault. If you want to restore a VM from a backup from the last seven days, it's quicker to restore from the snapshot and not from the vault.

Storage accounts

Some details about storage accounts:

  • Create VM: When you create a new VM, the VM will be placed in the storage account you specify.
  • Restore disk: When you restore a disk, the disk is copied to the storage account you specify. The restore job generates a template that you can download and use to specify custom VM settings. This template is placed in the specified storage account.
  • Replace disk: When you replace a disk on an existing VM, Azure Backup takes a snapshot of the existing VM before replacing the disk. The snapshot is stored in the staging location (storage account) you specify. This storage account is used to temporarily store the snapshot during the restore process, and we recommend that you create a new account to do this, that can be easily removed afterwards.
  • Storage account location : The storage account must be in the same region as the vault. Only these accounts are displayed. If there are no storage accounts in the location, you need to create one.
  • Storage type : Blob storage isn't supported.
  • Storage redundancy: Zone redundant storage (ZRS) isn't supported. The replication and redundancy information for the account is shown in parentheses after the account name.
  • Premium storage:
    • When restoring non-premium VMs, premium storage accounts aren't supported.
    • When restoring managed VMs, premium storage accounts configured with network rules aren't supported.

Select a restore point

  1. In the search bar at the top, search for Recovery Services Vault and click on the item returned.
  2. Click on the name of your recovery services vault. In this example, we’re looking for myRecoveryServicesVault.

  3. In the vault associated with the VM you want to restore, click Backup items > Azure Virtual Machine.

 

  1. Click on your VM. In this example mine is called sorobert-TestVM. By default on the VM dashboard, recovery points from the last 30 days are displayed. You can display recovery points older than 30 days, or filter to find recovery points based on dates, time ranges, and different types of snapshot consistency.

  2. To restore the VM, click Restore VM.
  3. Select a restore point to use for the recovery. In this example, click on the one labeled Application Consistent and click on OK.  It is our most recent full backup.

Choose a VM restore configuration

  1. In Restore configuration, select a restore option. In this example, select Replace Existing.  The other options are detailed below:
    • Create new: Use this option if you want to create a new VM. You can create a VM with simple settings, or restore a disk and create a customized VM.
    • Replace existing: Use this option if you want to replace disks on an existing VM.

 

  1. Select Replace Disks and the storage account we created above as the staging location and click on OK.

  2. After your operation is validated, click on Restore.

Track the restore operation

After you trigger the restore operation, the backup service creates a job for tracking. Azure Backup displays notifications about the job in the portal. If they aren't visible, click on the Notifications symbol to see them.


Track restore as follows:

  1. To view operations for the job, click the notifications hyperlink. Alternatively, in the vault, click Backup jobs, and then click the relevant VM.

  2. To monitor restore progress, click any restore job with a status of In-progress. This displays the progress bar which displays information about the restore progress:
    • Estimated time of restore: Initially provides the time taken to complete the restore operation. As the operation progresses, the time taken reduces and reaches zero when the restore operation finishes.
    • Percentage of restore. Shows the percentage of restore operation that's done.
    • Number of bytes transferred: If you're restoring by creating a new VM, it shows the bytes that were transferred against the total number of bytes to be transferred.

Post-restore steps

There are a number of things to note after restoring a VM:

  • Extensions present during the backup configuration are installed, but not enabled. If you see an issue, reinstall the extensions.
  • 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.
  • 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.
  • 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.

 

  1. Connect to the VM a verify that the file TextFile.txt has been restored.

 

Backing up restored VMs

  • If you restored a VM to the same resource group with the same name as the originally backed-up VM, backup continues on the VM after restore.
  • If you restored the VM to a different resource group or you specified a different name for the restored VM, you need to set up backup for the restored VM.




Keywords:backup, data, virtual, machine   Doc ID:97721
Owner:Scott R.Group:University of Illinois at Chicago ACCC
Created:2020-02-06 15:26 CDTUpdated:2020-02-26 22:23 CDT
Sites:University of Illinois at Chicago ACCC
Feedback:  0   0