Add-VBRHvReplicaJob
Short Description
Creates Hyper-V replication jobs.
Applies to
Platform: Hyper-V
For VMware, run Add-VBRViReplicaJob.
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
Add-VBRHvReplicaJob -Server <CHost> -Entity <IHvItem[]> [-Name <string>] [-Path <string>] [-Suffix <string>] [-Description <string>] [-SourceRepository <CBackupRepository[]>] [-BackupRepository <CBackupRepository>] [-ReIpRule <VBRHvReplicaReIpRule[]>] [-RepositorySeed <CBackupRepository>] [-OriginalVM <CHvVmItem[]>] [-ReplicaVM <CHvVmItem[]>] [-Force] [-HighPriority] [<CommonParameters>] |
Detailed Description
This cmdlet creates a new Hyper-V replication job.
You can select a data source from which VM data must be read:
- Actual VM: Veeam Backup & Replication will copy an actual VM from production storage. The created replica will mirror an actual VM state.
Use the Entity parameter to indicate the VMs you want to replicate.
- Replica from backup files: Veeam Backup & Replication will build a replica from backup files stored in a backup repository. The created replica will be in the latest state the VM is available in backups.
Use the Entity parameter to indicate the VMs you want to replicate and the BackupRepository parameter to set the repository from where the backup files must be read.
Note that when you create a replica job, you need to run it manually unless you enable a job schedule.
Run Start-VBRJob to start the created job manually.
Run Set-VBRJobSchedule to set schedule for the job and run it automatically.
Starting from Veeam Backup & Replication version 9.5 Update 3, the cmdlet checks if the data of the VMs added to the job changes its geographical location.
Note |
The cmdlet will not run if the geographical location of the VMs added to the job and the job target repository location do not match. If you still want to run the cmdlet, use the Force parameter. |
Parameters
Parameter | Description | Required | Position | Accept | Accept |
---|---|---|---|---|---|
Name | Specifies the name you want to assign to the replication job. | False | Named | False | False |
Server | Specifies the target Hyper-V host where the created replica will be stored. | True | Named | False | False |
Path | Specifies the Hyper-V volume where the created replica will be stored. | True | Named | False | False |
Entity | Specifies the array of VMs you want to add to this job. | True | Named | True (ByValue, | False |
Suffix | Specifies the suffix that will be appended to the name of the VM you are replicating. This name will be used to register the replicated VM on the target server. Default: "_replica". | False | Named | False | False |
Description | Specifies the description of the replication job. | False | Named | False | False |
SourceRepository | For building replica from backup files. Specifies the backup repository that will be used to read the VM data from the already existing backup chain. You cannot specify cloud repository. | False | Named | False | False |
BackupRepository | Specifies the backup repository that will be used to store replica metadata files. Default: default backup repository. | False | Named | False | False |
ReIpRule | Specifies the re-IP rules. Accepts VBRHvReplicaReIpRule type. | False | Named | False | False |
RepositorySeed | For replica seeding. Specifies the backup repository where the seed (the full backup) resides. | False | Named | False | False |
OriginalVM | For replica mapping. Specifies the production VM you want to replicate using replica mapping. The replication job will map this VM to a selected replica VM on the DR site. Use the ReplicaVM parameter to specify the replica VM on the DR site. | False | Named | False | False |
ReplicaVM | For replica mapping. Specifies the VM on the DR site you want to use as the replication target. The replication job will map the production VM to this VM. Use the OriginalVM parameter to specify the production VM. | False | Named | False | False |
Force | Indicates that the cmdlet will create a job even if the geographical location of the VMs added to the job and the target host location do not match. | False | Named | False | False |
HighPriority | Note: This parameter is available starting from Veeam Backup & Replication 11a (build 11.0.1.1261). Defines that Veeam Backup & Replication will prioritize this job higher than other similar jobs and will allocate resources to it in the first place. | 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 command creates a VM replica from a production storage.
- Run Find-VBRHvEntity to get the VM you want to replicate. Save it to the $entity variable.
- Run Get-VBRServer to get the server, where you want to locate the replica. Save it to the $targetserver variable.
- Run Add-VBRHvReplicaJob. Use the $entity and $targetserver variables.
$entity = Find-VBRHvEntity -Name "sql02" $targetserver = Get-VBRServer -Type HvServer -Name "Hv_Server" Add-VBRHvReplicaJob -Name "SQL02 Replica job" -Entity $entity -Server $targetserver -Path "c:\Replicas" -Suffix "_replicated" -Description "SQL02 replication" |
Example 2
This command creates a VM replica from backup files.
- Run Find-VBRHvEntity to get the VM you want to replicate. Save it to the '$sql02' variable.
- Run Get-VBRServer to get the server, where you want to locate the replica. Save it to the $targetserver variable.
- Run Get-VBRBackupRepository to get the repository where the backup files for the replica reside. Save it to the $repository variable.
$entity = Find-VBRHvEntity -Name "HvExchange" $targetserver = Get-VBRServer -Type HvServer -Name "Hv_Server" Add-VBRHvReplicaJob -Name "SQL02 Replica job" -Server $targetserver -Path "c:\Replicas" -Entity $sql02 -Description "SQL02 replication" -SourceRepository $repository |
Related Commands