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

Start-VBRHvRestoreVM

Short Description

Starts restore of the entire Hyper-V VM.

Applies to

Platform: Hyper-V

For VMware, run Start-VBRRestoreVM.

Product Edition: Standard, Enterprise, Enterprise Plus

Syntax

This cmdlet provides the following parameter sets:

  • For restore to a new location, and/or to original location with different settings

Start-VBRHvRestoreVM [-RestorePoint] <COib> [-Server <CHost>] [-Path <string>] [-VMName <string>] [-PreserveVmID<bool>] [-PowerUp] [-RegisterAsClusterResource] [-NICsEnabled <bool>] [-PreserveMACs <bool>] [-User <string>][-Password <string>] [-Credential <pscredential>] [-Reason <string>] [-RunAsync] [-QuickRollback] [-Force][-EnableAntivirusScan] [-EnableEntireVolumeScan] [-VirusDetectionAction <VBRVirusDetectionAction> {DisableNetwork | AbortRecovery}]  [<CommonParameters>]

  • For restore to a new location, or with different settings

Start-VBRHvRestoreVM [-RestorePoint] <COib> -EnableStagedRestore -StagingVirtualLab <CHvSbVirtualLab> -StagingScript <string> -StagingCredentials <CInternalCredentials> [-Server <CHost>] [-Path <string>] [-VMName <string>] [-PreserveVmID <bool>] [-PowerUp] [-RegisterAsClusterResource] [-NICsEnabled <bool>] [-PreserveMACs <bool>] [-User <string>] [-Password <string>] [-Credential <pscredential>] [-Reason <string>] [-RunAsync][-QuickRollback] [-Force] [-StagingApplicationGroup <CSbAppGroup>] [-StagingStartupOptions <VBRApplicationGroupStartupOptions>] [-EnableAntivirusScan] [-EnableEntireVolumeScan] [-VirusDetectionAction <VBRVirusDetectionAction> {DisableNetwork | AbortRecovery}]  [<CommonParameters>]

Detailed Description

This cmdlet starts the restore of the entire VM. With this cmdlet, you can perform the following recover scenarios:

  • Restore to original location
  • Restore to original location with different settings
  • Restore to another location
  • Staged restore
  • Secure restore

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Restore
Point

Specifies the restore point to which you want to restore VMs.

True

1

True (ByValue,
ByProperty
Name)

False

EnableStaged
Restore

NOTE: This parameter is required for staged restore only.

Indicates that the cmdlet will perform staged restore.

True

Named

False

 

Staging
Credentials

NOTE: This parameter is required for staged restore only.

Specifies the credentials for the account that has administrator privileges on VMs that you want to restore.

The cmdlet will use these credentials to authenticate against VMs and run the script.

Accepts the CInternalCredentials type.

True

Named

False

 

Staging
Script

NOTE: This parameter is required for staged restore only.

Specifies the script location. Veeam Backup & Replication will use this script to prepare VMs before the restore.

True

Named

False

 

Staging
VirtualLab

NOTE: This parameter is required for staged restore only.

Specifies the virtual lab. The cmdlet will use this virtual lab to start VMs and run the script.

True

Named

False

 

Server

Specifies the host where you want to locate the restored VM. By default, the cmdlet will restore a VM to its original location.

This parameter is required for the staged restore jobs.

False

Named

False

False

Path

Specifies the path to the folder where you want to restore the VM.

False

Named

False

False

VMName

Specifies the name you want to apply to the restored VM. By default, the original VM name is applied.

False

Named

False

False

Preserve
VmID

Indicates that the restored VM will get the UUID of the original VM.

NOTE: The cmdlet deletes the original VM if you restore it to the same Hyper-V host.
This is done to avoid UUID conflicts. To keep both VMs in the same location, the restored VM must have a new UUID and a different name. To generate a new UUID, set this parameter to False.

Default: True.

False

Named

False

False

PowerUp

If set, the restored VM will be powered up immediately after the restore. Otherwise, you will have to power up the VM manually.

False

Named

False

False

RegisterAs
Cluster
Resource

If set, the restored VM will be registered as a part of a cluster in case you restore the VM to a clustered host.

False

Named

False

False

NICsEnabled

If set to True, the restored VM will be connected to the network. Otherwise, the VM will have no network connections.

Default: False.

False

Named

False

False

PreserveMACs

If set to True, the restored VM will get the MAC address of the original VM. Otherwise, the restored VM will get a new MAC address.

NOTE: if the original VM keeps running, preserving the MAC address will cause conflict. Preserving the MAC address is useful in case the original VM will not be used in future - in this case, the restored VM will be able to use the MAC settings used by its applications, if any are installed.

Default: False.

False

Named

False

False

User

Specifies the user name you want to use for authenticating with the VM.

NOTE: If you use the Username/Password scenario, the Credentials parameter must be omitted.

False

Named

False

False

Password

Specifies the password you want to use for authenticating with the VM.

NOTE: If you use the Username/Password scenario, the Credentials parameter must be omitted.

False

Named

False

False

Credential

Specifies the credentials you want to use for authenticating with the VM.

NOTE: If you use the Credentials scenario, the User and Password parameters must be omitted.

False

Named

False

False

Reason

Specifies the reason for performing restore of the selected VM.

The information you provide will be saved in the session history so that you can reference it later.

False

Named

False

False

RunAsync

Indicates that the command returns immediately without waiting for the task to complete.

False

Named

False

False

QuickRollback

For restore to original location.

Indicates that the incremental restore must be performed.

False

Named

False

False

Force

Indicates that the cmdlet will perform VM restore even if the geographical location of the repository where VM backups reside and the target host location do not match.

False

Named

False

False

Staging
Application
Group

For staged restore.

Specifies the application group that the cmdlet will use for staged restore.

Accepts the CSbAppGroup type.

False

Named

False

False

Staging
Startup
Options

For staged restore.

Specifies startup settings of VMs that you want to restore. Veeam Backup & Replication will use these settings to start selected VMs after recovery.

Accepts the  VBRApplicationGroupStartupOptions type.

False

Named

False

False

Enable
Antivirus
Scan

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

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

False

Virus
Detection
Action

For secure restore.

Specifies the secure restore action when the infection is detected.

  • DisableNetwork - use this option if you want to restore VMs in with disabled network adapters (NICs).
  • AbortRecovery - use this option if you want to cancel the restore session.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Example 1

This example shows how to restore a VM to its original location.

  1. Run Get-VBRRestorePoint to get an array of restore points for the selected VM. Save the result to the $restorepoint variable.
  2. Run Start-VBRHvRestoreVM with the $restorepoint variable to perform VM restore.

If you want to clone the original VM and keep both copies in the same location, the restored VM must have a different name and UUID. For that, specify the VMName parameter and set the PreserveVmID parameter to False. Otherwise, the cmdlet will replace the original VM with the restored one.

$restorepoint = Get-VBRRestorePoint -Name srv01 | Sort -Property СreationTime -Descending | Select -First 1

Start-VBRHvRestoreVM -RestorePoint $restorepoint -VMName srv01_copy -PreserveVmID $false

Example 2

This example shows how to restore a VM to another location.

  1. Run Get-VBRRestorePoint to get an array of restore points for the selected VM. Save the result to the $restorepoint variable.
  2. Run Get-VBRServer to get the host where you want to locate the restored VM. Save the result to the $server variable.
  3. Run Start-VBRHvRestoreVM with the $rp and $server variables to perform VM restore. Use the Path parameter to specify the path to the folder on the target host where you want to restore the VM.

$restorepoint = Get-VBRRestorePoint -Name "srv01"

$server = Get-VBRServer -Type HvServer -Name "hyperv01.east.support"

Start-VBRHvRestoreVM –RestorePoint $restorepoint[1] –Server $server -Path "D:\Storage\HyperV\srv01_restored"

Example 3

The example shows how to perform staged restore for the selected VM.

  1. Run Get-VBRRestorePoint to get an array of the restore points for the selected VM. Save the result to the $restorepoint variable.
  2. Run Get-VSBHvVirtualLab to specify the virtual lab for the staged restore. Save the result to the $lab variable.
  3. Run Get-VBRCredentials to specify the credentials for the account that has administrator privileges on the VM that you want to restore. Save the result to the $creds variable.
  4. Run Start-VBRRestoreVM with the $restorepoint, $lab and $creds variables. Use the following parameters to specify additional settings:
  • Use the StagingScript parameter to specify the script location
  • Use the EnableStagedRestore parameter to enable staged restore

$restorepoint = Get-VBRRestorePoint

$lab = Get-VSBHvVirtualLab -Name VirtualLab

$creds = Get-VBRCredentials -Name Administrator

Start-VBRRestoreVM -RestorePoint $restorepoint[0] -StagingVirtualLab $lab -StagingScript "c:/script.cmd" -EnableStagedRestore -StagingCredentials $creds

Example 4

The example shows how to perform secure restore for the selected VM. The restore session will run with the following settings:

  • The antivirus will continue VM scan after the first virus threat is found
  • In case the threat is detected, Veeam Backup & Replication will restore the VM with disabled NIC
  • The RunAsync parameter is set to bring the process to the background

You must perform the following steps:

  1. Run Get-VBRRestorePoint to get an array of the restore points for the selected VM. Save the result to the $restorepoint variable.
  2. Run Start-VBRHVRestoreVM with the $restorepoint variable. Set the DisableNetwork value for the VirusDetectionAction parameter to restore the VM with disabled NIC.

$restorepoint = Get-VBRRestorePoint

Start-VBRHVRestoreVM -RestorePoint $restorepoint[1] -RunAsync -EnableAntivirusScan -EnableEntireVolumeScan -VirusDetectionAction DisableNetwork

Related Commands

Get-VBRRestorePoint

Get-VBRServer

Get-VBRLocation

Get-VSBHvVirtualLab

Get-VBRCredentials

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

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation

Quick Start Guide for VMware vSphere

Quick Start Guide for Microsoft Hyper-V