This is an archive version of the document. To get the most up-to-date information, see the current version.

Add-VBRHvReplicaJob

In this article

    Short Description

    Creates a new Hyper-V replication job.

    Applies to

    Platform: Hyper-V

    For VMware, run Add-VBRViReplicaJob.

    Product Edition: Standard, Enterprise, Enterprise Plus

    Syntax

    Add-VBRHvReplicaJob -Server <CHost> -Entity <IHvItem[]> [-Name <string>] [-Path <string>] [-Suffix <string>] [-Description <string>] [-SourceRepository <CBackupRepository[]>] [-BackupRepository <CBackupRepository>] [-ReIpRule <VBRHvReplicaReIpRule[]>]  [<CommonParameters>]

    Related Commands

    Get-VBRServer

    Find-VBRHvEntity

    Get-VBRBackupRepository

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

    Parameters

    Parameter

    Description

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    Name

    Specifies the name you want to assign to the replication job.

    If not set, Veeam Backup & Replication will give the default job name.

    False

    Named

    False

    False

    Server

    Specifies the Hyper-V host where the created replica should be stored.

    True

    Named

    False

    False

    Path

    Specifies the Hyper-V volume where the created replica should be stored.

    True

    Named

    False

    False

    Entity

    Specifies the VM(s) that you want to replicate.

    You can assign multiple VMs to this object.

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    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.

    If omitted, the replicated VMs will have the '_replica' suffix by default.  

    False

    Named

    False

    False

    Description

    Specifies the description of the replication job.

    If not set, Veeam Backup & Replication will enter date and time of creation by default.

    False

    Named

    False

    False

    Source
    Repository

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

    Accepts CBackupRepository object.

    You cannot specify cloud repository.

    False

    Named

    False

    False

    Backup
    Repository

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

    Accepts CBackupRepository object.

    False

    Named

    False

    False

    ReIpRule

    Specifies the re-IP rules.

    Accepts VBRViReplicaReIpRule object.

    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.

    Example 1

    This command creates a job that replicates an SQL02 server. The replica is located on another host.

    • The host to locate the replicated VM on is obtained with Get-VBRServer and assigned to the '$targetserver' variable beforehand.
    • The replica is created with the suffix "_replicated".
    • The description of the job is "SQL02 replication".

    PS C:\PS> Find-VBRHvEntity -Name "sql02" | Add-VBRHvReplicaJob -Name "SQL02 Replica job" -Server $targetserver -Path "c:\Replicas" -Suffix "_replicated" -Description "SQL02 replication"

    Example 2

    This command creates a replica of an SQL server from backup. The replica is located on another host.

    • The VM to replicate is obtained with Find-VBRHvEntity and assigned to the '$sql02' variable.
    • The host to locate the replicated VM on is obtained with Get-VBRServer and assigned to the '$targetserver' variable beforehand.
    • The replica will be built from the SQL02 backup files that are located on a backup repository. The repository is obtained with Get-VBRBackupRepository and assigned to the '$repository' variable beforehand.
    • The description of the job is "SQL02 replication".

    PS C:\PS> Add-VBRHvReplicaJob -Name "SQL02 Replica job" -Server $targetserver -Path "c:\Replicas" -Entity $sql02 -Description "SQL02 replication" -SourceRepository $repository