Help Center
Choose product document...
Veeam Backup & Replication 9.5
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 2 parameter sets.

  • For Microsoft Azure Resource Manager:

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>] [-Wait] [<CommonParameters>]

  • For Microsoft Azure Classic:

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>] [-Wait]  [<CommonParameters>]

Detailed Description

This cmdlet restores VM backups to Microsoft Azure.

You can restore to Resource Manager and to Classic accounts. Select the appropriate parameter set for each account model.

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 (by Value
FromPipeline, ValueFromPipeline
ByPropertyName)

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

NewResourceGroupName

For Microsoft Azure Resource Manager accounts.

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

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 accounts.

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 a Resource Manager account:

  1. Get the restore point of the Veeam backup you want to restore. Run Get-VBRRestorePoint and save the result to the $restorepoint variable.
  2. Get the Microsoft Azure subscription. Run Get-VBRAzureAccount to get the Microsoft Azure account. Save it to the $account variable. Run Get-VBRAzureSubscription using the $account variable to get the subscription. Save it to the $suscription variable.
  3. Get the Microsoft Azure storage account. Run Get-VBRAzureStorageAccount and save it to the $storageaccount variable.
  4. Get the Microsoft Azure VM configuration. Run Get-VBRAzureLocation to get the location of the Microsoft Azure datacenter. Save it to the $location variable. Run Get-VBRAzureVMSize using the $location variable. Save it to the $vmsize variable.
  5. Get the Microsoft Azure virtual network. Run Get-VBRAzureVirtualNetwork and save the result to the $network variable.
  6. Get the Microsoft Azure virtual network subnet. Run Get-VBRAzureVirtualNetworkSubnet and save the result to the $subnet variable.
  7. Get the Microsoft Azure resource group. Run Get-VBRAzureResourceGroup and save the result to the $resourcegroup variable.
  8. Run Start-VBRVMRestoreToAzure. Use the saved variables.

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

PS C:\PS> $account = Get-VBRAzureAccount -Type ResourceManager -Name "RestoreToAzureRM@Veeam.com"

PS C:\PS> $subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

PS C:\PS> $storageaccount = Get-VBRAzureStorageAccount -Subscription $subscription -Name "VeeamDirectRestore2AzureStorage"

PS C:\PS> $location = Get-VBRAzureLocation -Subscription $subscription -Name australiaeast

PS C:\PS> $vmsize = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_G3

PS C:\PS> $network = Get-VBRAzureVirtualNetwork -Subscription $subscription -Name "VeeamInternalNetwork"

PS C:\PS> $subnet = Get-VBRAzureVirtualNetworkSubnet -Network $network -Name "VeeamInternalSubnet"

PS C:\PS> $resourcegroup = Get-VBRAzureResourceGroup -Subscription $subscription -Name "VeeamResourceGroup"

PS C:\PS> 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. Get the restore point of the Veeam backup you want to restore. Run Get-VBRRestorePoint and save the result to the $restorepoint variable.
  2. Get the Microsoft Azure subscription. Run Get-VBRAzureAccount to get the Microsoft Azure account. Save it to the $account variable. Run Get-VBRAzureSubscription using the $account variable to get the subscription. Save it to the $suscription variable.
  3. Get the Microsoft Azure storage account. Run Get-VBRAzureStorageAccount and save it to the $storageaccount variable.
  4. Get the Microsoft Azure VM configuration. Run Get-VBRAzureLocation to get the location of the Microsoft Azure datacenter. Save it to the $location variable. Run Get-VBRAzureVMSize using the $location variable. Save it to the $vmsize variable.
  5. Run Get-VBRAzureVMSize to get the Microsoft Azure VM configuration. Save it to the $vmsize variable.
  6. Run Start-VBRVMRestoreToAzure. Use the saved variables.

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

PS C:\PS> $account = Get-VBRAzureAccount -Type Classic -Name "RestoreToAzure@Veeam.com"

PS C:\PS> $subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

PS C:\PS> $storageaccount = Get-VBRAzureStorageAccount -Subscription $subscription -Name "VeeamDirectRestore2AzureStorage"

PS C:\PS> $location = Get-VBRAzureLocation -Subscription $subscription -Name "Classic Central US"

PS C:\PS> $vmsize = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_G3

PS C:\PS> 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.

This example uses a number of variables. They are identical to the examples above. For details on how to get them, see the Example 1 and 2.

  1. Get the needed instances and save them to variables.
  2. Get the gateway server. Run Get-VBRServer and save the result to the $gateway variable.
  3. Run Start-VBRVMRestoreToAzure. Use the saved variables.

PS C:\PS> $gateway = Get-VBRServer -Name "azureproxy.cloudapp.net"

PS C:\PS> 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 Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Endpoint Backup Documentation

Veeam Management Pack Documentation