Edit

Share via


Start-VMInitialReplication

Starts replication of a virtual machine.

Syntax

VMName (Default)

Start-VMInitialReplication
    [-VMName] <String[]>
    [-ComputerName <String[]>]
    [-DestinationPath <String>]
    [-InitialReplicationStartTime <DateTime>]
    [-UseBackup]
    [-AsJob]
    [-Passthru]
    [-CimSession <CimSession[]>]
    [-Credential <PSCredential[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMObject

Start-VMInitialReplication
    [-VM] <VirtualMachine[]>
    [-DestinationPath <String>]
    [-InitialReplicationStartTime <DateTime>]
    [-UseBackup]
    [-AsJob]
    [-Passthru]
    [-CimSession <CimSession[]>]
    [-Credential <PSCredential[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMReplication

Start-VMInitialReplication
    [-VMReplication] <VMReplication[]>
    [-DestinationPath <String>]
    [-InitialReplicationStartTime <DateTime>]
    [-UseBackup]
    [-AsJob]
    [-Passthru]
    [-CimSession <CimSession[]>]
    [-Credential <PSCredential[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Start-VMInitialReplication cmdlet starts replication of a virtual machine using the method you select. You also can schedule replication to start up to 7 days later.

Examples

Example 1

PS C:\> Start-VMInitialReplication VM01

This example starts initial replication of virtual machine VM01 over the network.

Example 2

PS C:\> Start-VMInitialReplication *

This example starts initial replication over the network for all the virtual machines on the local Hyper-V host for which initial replication is pending.

Example 3

PS C:\> Start-VMInitialReplication * -DestinationPath R:\IRLoc

This example exports the initial replication of all virtual machines on the local Hyper-V host for which initial replication is pending, to the location R:\IRLoc. This example assumes that the location is an external drive, which would be shipped to the Replica site so that the initial replication can be completed.

Example 4

PS C:\> Enable-VMReplication VM01 -AsReplica -computername MyReplica.contoso.com
PS C:\> Enable-VMReplication VMO1 -ReplicaServerName ReplicaServer01 -ReplicaServerPort 80 -AuthenticationType Kerberos -computername MyPrimary.contoso.comPS
PS C:\> Start-VMInitialReplication VM01 -usebackup -computername MyPrimary.contoso.com

This example uses several consecutive commands to start initial replication from backup. First, it enables a restored copy of virtual machine VM01 on the Replica server as a Replica virtual machine. Then, it enables replication for VM01 from the primary server. Finally, it starts the initial replication to use the restored copy of VM01 on Replica server as the basis of the initial replication.

Example 5

PS C:\> $VMRepl = Get-VMReplication -VMName MyVM
PS C:\> Start-VMInitialReplication -VMReplication $VMRepl

The first command returns a VMReplication object for the VM named MyVM and stores it in the variable $VMRepl.

The second cmdlet then uses this object to start the initial replication for the stored VM.

Parameters

-AsJob

Runs the cmdlet as a background job.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputerName

Specifies one or more Hyper-V hosts on which replication of a virtual machine is to be started. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Parameter properties

Type:

PSCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationPath

Specifies the path to use when copying the files for initial replication; assumes use of external media as the method for initial replication. External media is typically a removable drive that is shipped to the location of the Replica server. When the external media arrives at the Replica site, use the Import-InitialVMReplication cmdlet on the Replica virtual machine to copy the files.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IRLoc

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InitialReplicationStartTime

Specifies the time to start the initial replication, when scheduling initial replication to occur later. You can specify a time up to 7 days later. When this parameter is not specified, initial replication occurs immediately.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IRTime

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Passthru

Specifies that a virtual machine object is to be passed through to the pipeline representing the virtual machine on which replication is to be started.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UseBackup

Indicates that you want to use a copy of this virtual machine on the Replica server as the basis for the initial replication. Specify this option only if it was specified when replication was enabled on the primary virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VM

Specifies the virtual machine on which replication is to be started.

Parameter properties

Type:

VirtualMachine[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMName

Specifies the name of the virtual machine on which replication is to be started.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMReplication

Specifies an object that represents the replication to be started. You can get this object from the Get-VMReplication cmdlet.

Parameter properties

Type:

VMReplication[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMReplication
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

None

Default

Microsoft.HyperV.PowerShell.VirtualMachine

If -PassThru is specified.