Help Center
Choose product document...
Veeam Backup & Replication 9.5 Update 4
PowerShell Reference

Start-VBRVMRestoreToAzure

Short Description

Restores VM backups to Microsoft Azure.

Applies to

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus

Syntax

This cmdlet provides the following parameter sets:

  • For restoring to Azure with the following deployment models:
  • Microsoft Azure Resource Manager
  • Microsoft Azure Stack

Start-VBRVMRestoreToAzure -RestorePoint <COib> -Subscription <VBRAzureSubscription> -StorageAccount <VBRAzureStorageAccount> -VmSize <VBRAzureVMSize> -VirtualNetwork <VBRAzureVirtualNetwork> -VirtualSubnet <VBRAzureNetworkSubnet> [-ResourceGroup <VBRAzureResourceGroup>] [-NewResourceGroupName <string>] [-DisksToExclude <string[]>] [-VmName <string>] [-Reason <string>] [-GatewayServer <CHost>] [-Credentials <CCredentials>][-EnableAntivirusScan] [-EnableEntireVolumeScan] [-VirusDetectionAction <VBRAzureVirusDetectionAction> {ConnectToIsolatedNetwork | AbortRecovery}] [-VirusIsolatedNetwork <VBRAzureVirtualNetwork>][-VirusIsolatedNetworkSubnet <VBRAzureNetworkSubnet>] [-Wait]  [<CommonParameters>]

  • For Microsoft Azure Classic deployment model

Start-VBRVMRestoreToAzure -RestorePoint <COib> -Subscription <VBRAzureSubscription> -StorageAccount <VBRAzureStorageAccount> -VmSize <VBRAzureVMSize> [-DisksToExclude <string[]>] [-VmName <string>] [-CloudService <VBRAzureCloudService>] [-DNSName <string>] [-Endpoint <uint16>] [-VirtualNetwork <VBRAzureVirtualNetwork>][-VirtualSubnet <VBRAzureNetworkSubnet>] [-Reason <string>] [-GatewayServer <CHost>] [-Credentials <CCredentials>][-EnableAntivirusScan] [-EnableEntireVolumeScan] [-VirusDetectionAction <VBRAzureVirusDetectionAction> {ConnectToIsolatedNetwork | AbortRecovery}] [-VirusIsolatedNetwork <VBRAzureVirtualNetwork>][-VirusIsolatedNetworkSubnet <VBRAzureNetworkSubnet>] [-Wait]  [<CommonParameters>]

Detailed Description

This cmdlet restores VM backups to Microsoft Azure. You can restore the data to the following types of Microsoft Azure deployment models:

  • Microsoft Azure Resource Manager
  • Microsoft Azure Stack
  • For Microsoft Azure Classic

Start-VBRVMRestoreToAzure Important!

You must select the Microsoft Azure configuration options that supports the VM you restore. For example, if you restore a VM that has 4 disks, select an Azure VM configuration option that supports 4 or more disks.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

RestorePoint

Specifies the restore point of the backup you want to restore to Microsoft Azure.

True

Named

True (ByValue,
ByProperty
Name)

False

Subscription

Specifies the Microsoft Azure subscription. The cmdlet will restore the backup to this subscription.

True

Named

False

False

StorageAccount

Specifies the Microsoft Azure storage account. The restored VM will use this storage account.

True

Named

False

False

VmSize

Specifies the Microsoft Azure VM configuration option. The VM will use this configuration template.

True

Named

False

False

VirtualNetwork

Specifies the Microsoft Azure virtual network. The restored VM will be connected to this network.

For Resource Manager model: True

For Classic model: False

Named

False

False

VirtualSubnet

Specifies the Microsoft Azure virtual subnet. The restored VM will be connected to this subnet.

For Resource Manager model: True

For Classic model: False

Named

False

False

ResourceGroup

For Microsoft Azure Resource Manager accounts.

Specifies the Microsoft Azure resource group. The restored VM will use this restore group.

If you skip this parameter, the cmdlet will need to create a new resource group. Use the NewResourceGroupName parameter to create a new resource group. The new resource group is created with default resources.

False

Named

False

False

NewResource
GroupName

For Microsoft Azure Resource Manager deployment models.

Specifies the name of a new resource group. The cmdlet will create a new resource group with this name.

If you skip this parameter, use the ResourceGroup parameter to specify an existing resource group.

False

Named

False

False

DisksToExclude

Specifies the array of VM disk file names. Use this parameter to specify the VM disks that you want to exclude. The cmdlet will not restore these disks.

False

Named

False

False

VmName

Specifies the VM name. The restored VM will have this name.

If you do not specify a new name, the restored VM will have it's original name.

False

Named

False

False

Reason

Specifies the reason for performing restore.

False

Named

False

False

GatewayServer

Specifies the gateway server. The restore process will use this server to transfer the VM data to the Microsoft Azure datacenter.

If you skip this parameter, the restore process will use Veeam backup server as a gateway server.

False

Named

False

False

Credentials

For restoring backups located on a network shared folder.

Specifies the credentials to authenticate with the network shared folder.

False

Named

False

False

EnableAntivirusScan

Indicates that the cmdlet will perform secure restore. Veeam Backup & Replication will trigger the antivirus software to scan selected VMs before the restore.

False

Named

False

 

Enable
Entire
Volume
Scan

For secure restore.

Indicates that the antivirus will continue VMs scan after the first virus threat is found. Use this option if you want to get the report on all virus threats.

False

Named

False

 

Virus
Detection
Action

For secure restore.

Specifies secure restore action when the virus threat is detected.

  • ConnectToIsolatedNetwork - use this option if you want to restore a machine to the isolated network.
  • AbortRecovery - use this option if you want to cancel the restore session.

False

Named

False

 

VirusIsolatedNetwork

Specifies the Azure virtual network. Veeam Backup & Replication will restore the infected VM to the selected network.

Accepts the VBRAzureVirtualNetwork type.

False

Named

False

 

VirusIsolatedNetworkSubnet

Specifies the Azure virtual network subnet. Veeam Backup & Replication will restore the infected VM to the selected network.

Accepts the VBRAzureNetworkSubnet type.

 

 

 

 

Wait

Indicates that the command waits for the process to complete before accepting more input.

False

Named

False

False

CloudService

For Microsoft Azure Classic accounts.

Specifies the existing cloud service. The restored VM will be added to this cloud service.

If you skip this parameter, the cmdlet will create a new cloud service for the restored VM. Use the DNSName parameter to set the name for the new cloud service.

False

Named

False

False

DNSName

For Microsoft Azure Classic deployment model.

Specifies the name of the new cloud service.

If you skip this parameter, use the CloudService parameter to place the restored VM to an existing cloud service.

False

Named

False

False

Endpoint

For Microsoft Azure Classic accounts.

Specifies the port number. This port will be used to connect to the restored VM.

If you skip this parameter, the cmdlet will use the default port numbers:

For Windows VMs: 3389.

For Linux VMs: 22.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Return Type

VBRAzureRestoreSession

Example 1

This example shows how to restore a VM to Microsoft Azure for the Resource Manager deployment model.

  1. Run Get-VBRRestorePoint to get the restore point of the VM that you want to restore. Save the result to the $restorepoint variable.
  2. Run Get-VBRAzureAccount to get the Microsoft Azure credentials records. Save the result to the $account variable.
  3. Run Get-VBRAzureSubscription with the $account variable to get the subscription. Save the result to the $suscription variable.
  4. Run Get-VBRAzureStorageAccount to get the Microsoft Azure storage account. Save the result to the $storageaccount variable.
  5. Run Get-VBRAzureLocation to get the location of the Microsoft Azure datacenter. Save the result to the $location variable.
  6. Run Get-VBRAzureVMSize with the $location variable to get the VM configurations details. Save it to the $vmsize variable.
  7. Run Get-VBRAzureVirtualNetwork with the $subscription variable to get the Microsoft Azure virtual network. Save the result to the $network variable.
  8. Run Get-VBRAzureVirtualNetworkSubnet with the $network variable to get the Microsoft Azure virtual network subnet. Save the result to the $subnet variable.
  9. Run Get-VBRAzureResourceGroup with the $subscription variable to get the Microsoft Azure resource group. Save the result to the $resourcegroup variable.
  10. Run Start-VBRVMRestoreToAzure with the variables obtained beforehand.

$restorepoint = Get-VBRBackup -Name "MSExchange Backup" | Get-VBRRestorePoint -Name "MSExchange02" | Sort-Object $_.creationtime -Descending | Select -First 1

$account = Get-VBRAzureAccount -Type ResourceManager -Name "RestoreToAzureRM@Veeam.com"

$subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

$storageaccount = Get-VBRAzureStorageAccount -Subscription $subscription -Name "VeeamDirectRestore2AzureStorage"

$location = Get-VBRAzureLocation -Subscription $subscription -Name australiaeast

$vmsize = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_G3

$network = Get-VBRAzureVirtualNetwork -Subscription $subscription -Name "VeeamInternalNetwork"

$subnet = Get-VBRAzureVirtualNetworkSubnet -Network $network -Name "VeeamInternalSubnet"

$resourcegroup = Get-VBRAzureResourceGroup -Subscription $subscription -Name "VeeamResourceGroup"

Start-VBRVMRestoreToAzure -RestorePoint $restorepoint -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsize -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resourcegroup -VmName CRM_db_restored2Azure -Reason "Back up CRM_db to Microsoft Azure"

Example 2

This example shows how to restore a VM to a Classic account:

  1. Run Get-VBRRestorePoint to get the restore point of the VM that you want to restore. Save the result to the $restorepoint variable.
  2. Run Get-VBRAzureAccount to get the Microsoft Azure credentials records. Save the result to the $account variable.
  3. Run Get-VBRAzureSubscription with the $account variable to get the subscription. Save the result to the $suscription variable.
  4. Run Get-VBRAzureStorageAccount to get the Microsoft Azure storage account. Save the result to the $storageaccount variable.
  5. Run Get-VBRAzureLocation to get the location of the Microsoft Azure datacenter. Save the result to the $location variable.
  6. Run Get-VBRAzureVMSize with the $location variable to get the VM configurations details. Save it to the $vmsize variable.
  7. Run Start-VBRVMRestoreToAzure. Use the saved variables.

$restorepoint = Get-VBRBackup -Name "MSExchange Backup" | Get-VBRRestorePoint -Name "MSExchange02" | Sort-Object $_.creationtime -Descending | Select -First 1

$account = Get-VBRAzureAccount -Type Classic -Name "RestoreToAzure@Veeam.com"

$subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

$storageaccount = Get-VBRAzureStorageAccount -Subscription $subscription -Name "VeeamDirectRestore2AzureStorage"

$location = Get-VBRAzureLocation -Subscription $subscription -Name "Classic Central US"

$vmsize = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_G3

Start-VBRVMRestoreToAzure -RestorePoint $restorepoint -Subscription $subscription -StorageAccount $storageaccount -VmSize A10 -DNSName "CRM_db_Restored_to_Azure" -Endpoint 443 -Reason "Back up CRM_db to Microsoft Azure"

Example 3

This example shows how to start a restore using a gateway server.

  1. Run Get-VBRRestorePoint to get the restore point of the VM that you want to restore. Save the result to the $restorepoint variable.
  2. Run Get-VBRAzureAccount to get the Microsoft Azure credentials records. Save the result to the $account variable.
  3. Run Get-VBRAzureSubscription with the $account variable to get the subscription. Save the result to the $suscription variable.
  4. Run Get-VBRAzureStorageAccount to get the Microsoft Azure storage account. Save the result to the $storageaccount variable.
  5. Run Get-VBRAzureLocation to get the location of the Microsoft Azure datacenter. Save the result to the $location variable.
  6. Run Get-VBRAzureVMSize with the $location variable to get the VM configurations details. Save it to the $vmsize variable.
  7. Run Get-VBRAzureVirtualNetwork with the $subscription variable to get the Microsoft Azure virtual network. Save the result to the $network variable.
  8. Run Get-VBRAzureVirtualNetworkSubnet with the $network variable to get the Microsoft Azure virtual network subnet. Save the result to the $subnet variable.
  9. Run Get-VBRAzureResourceGroup with the $subscription variable to get the Microsoft Azure resource group. Save the result to the $resourcegroup variable.
  10. Get the gateway server. Run Get-VBRServer and save the result to the $gateway variable.
  11. Run Start-VBRVMRestoreToAzure. Use the saved variables.

$restorepoint = Get-VBRBackup -Name "MSExchange Backup" | Get-VBRRestorePoint -Name "MSExchange02" | Sort-Object $_.creationtime -Descending | Select -First 1

$account = Get-VBRAzureAccount -Type Classic -Name "RestoreToAzure@Veeam.com"

$subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

$storageaccount = Get-VBRAzureStorageAccount -Subscription $subscription -Name "VeeamDirectRestore2AzureStorage"

$location = Get-VBRAzureLocation -Subscription $subscription -Name "Classic Central US"

$vmsize = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_G3

$gateway = Get-VBRServer -Name "azureproxy.cloudapp.net"

Start-VBRVMRestoreToAzure -RestorePoint $restorepoint -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsize -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resourcegroup -VmName CRM_db_restored2Azure -Reason "Back up CRM_db to Microsoft Azure" -GatewayServer $gateway

Related Commands

Get-VBRRestorePoint

Get-VBRAzureSubscription

Get-VBRAzureStorageAccount

Get-VBRAzureVMSize

Get-VBRAzureVirtualNetwork

Get-VBRAzureVirtualNetworkSubnet

Get-VBRServer

Get-VBRAzureResourceGroup

Get-VBRCredentials

Get-VBRAzureCloudService

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Explorers User Guide

Backup and Restore of SQL Server Databases

Veeam Plug-ins for Enterprise Applications

PowerShell Reference

Veeam Explorers PowerShell Reference

RESTful API Reference

Required Permissions Reference

Veeam Availability for Nutanix AHV Documentation

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation