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 | Accept |
Restore | Specifies the restore point to which you want to restore VMs. | True | 1 | True (ByValue, | False |
EnableStaged | NOTE: This parameter is required for staged restore only. Indicates that the cmdlet will perform staged restore. | True | Named | False |
|
Staging | 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 | 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 | 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 |
PreserveVmID | 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. To keep the original and the copy of the VM in the same location, you must specify the PreserveVmID and the Path parameters. 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 | 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 | For staged restore. Specifies the application group that the cmdlet will use for staged restore. Accepts the CSbAppGroup type. | False | Named | False | False |
Staging | 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 | 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 | 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 | For secure restore. Specifies the secure restore action when the infection is detected.
| 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. The cmdlet will keep both copies of the VM in the same location.
- Run Get-VBRRestorePoint to get an array of restore points for the selected VM. Save the result to the $restorepoint variable.
- Run Start-VBRHvRestoreVM with the $restorepoint variable to perform VM restore.
$restorepoint = Get-VBRRestorePoint -Name srv01 | Sort -Property CreationTime -Descending | Select -First 1 Start-VBRHvRestoreVM -RestorePoint $restorepoint -VMName srv01_copy -PreserveVmID $false -Path "D:\Restored" |
Example 2
This example shows how to restore a VM to another location.
- Run Get-VBRRestorePoint to get an array of restore points for the selected VM. Save the result to the $restorepoint variable.
- Run Get-VBRServer to get the host where you want to locate the restored VM. Save the result to the $server variable.
- 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.
- Run Get-VBRRestorePoint to get an array of the restore points for the selected VM. Save the result to the $restorepoint variable.
- Run Get-VSBHvVirtualLab to specify the virtual lab for the staged restore. Save the result to the $lab variable.
- 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.
- 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:
- Run Get-VBRRestorePoint to get an array of the restore points for the selected VM. Save the result to the $restorepoint variable.
- 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