편집

다음을 통해 공유


Enable-VMReplication

Enables replication of a virtual machine.

Syntax

VMName (Default)

Enable-VMReplication
    [-VMName] <String[]>
    [-ReplicaServerName] <String>
    [-ReplicaServerPort] <Int32>
    [-AuthenticationType] <ReplicationAuthenticationType>
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-CertificateThumbprint <String>]
    [-CompressionEnabled <Boolean>]
    [-ReplicateHostKvpItems <Boolean>]
    [-BypassProxyServer <Boolean>]
    [-EnableWriteOrderPreservationAcrossDisks <Boolean>]
    [-VSSSnapshotFrequencyHour <Int32>]
    [-RecoveryHistory <Int32>]
    [-ReplicationFrequencySec <Int32>]
    [-ExcludedVhd <HardDiskDrive[]>]
    [-ExcludedVhdPath <String[]>]
    [-AutoResynchronizeEnabled <Boolean>]
    [-AutoResynchronizeIntervalStart <TimeSpan>]
    [-AutoResynchronizeIntervalEnd <TimeSpan>]
    [-AsJob]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMName_AsReplica

Enable-VMReplication
    [-VMName] <String[]>
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-AsReplica]
    [-AllowedPrimaryServer <String>]
    [-AsJob]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMObject

Enable-VMReplication
    [-VM] <VirtualMachine[]>
    [-ReplicaServerName] <String>
    [-ReplicaServerPort] <Int32>
    [-AuthenticationType] <ReplicationAuthenticationType>
    [-Credential <PSCredential[]>]
    [-CertificateThumbprint <String>]
    [-CompressionEnabled <Boolean>]
    [-ReplicateHostKvpItems <Boolean>]
    [-BypassProxyServer <Boolean>]
    [-EnableWriteOrderPreservationAcrossDisks <Boolean>]
    [-VSSSnapshotFrequencyHour <Int32>]
    [-RecoveryHistory <Int32>]
    [-ReplicationFrequencySec <Int32>]
    [-ExcludedVhd <HardDiskDrive[]>]
    [-ExcludedVhdPath <String[]>]
    [-AutoResynchronizeEnabled <Boolean>]
    [-AutoResynchronizeIntervalStart <TimeSpan>]
    [-AutoResynchronizeIntervalEnd <TimeSpan>]
    [-AsJob]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMObject_AsReplica

Enable-VMReplication
    [-VM] <VirtualMachine[]>
    [-Credential <PSCredential[]>]
    [-AsReplica]
    [-AllowedPrimaryServer <String>]
    [-AsJob]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Enable-VMReplication cmdlet enables replication of a virtual machine to a specified Replica server.

Examples

Example 1

PS C:\>  Enable-VMReplication VM01 server01.domain01.contoso.com 80 Kerberos

This example configures replication for a virtual machine named VM01 on the local Hyper-V host and directs replication traffic to port 80 on a Replica server named server01.domain01.contoso.com, using Kerberos as the type of authentication.

Example 2

PS C:\>  Enable-VMReplication * server01.domain01.contoso.com 80 Kerberos

This example configures replication for all virtual machines on the local Hyper-V host to replica server and directs replication traffic to port 80 on a Replica server named server01.domain01.contoso.com, using Kerberos as the type of authentication.

Example 3

PS C:\>  Enable-VMReplication VM01 -AsReplica -AllowedPrimaryServer *.domain01.contoso.com

This example configures a virtual machine VM02 as a replica virtual machine and allows replication of the primary virtual machine from all primary servers that belong to a ___domain named domain01.contoso.com.

Parameters

-AllowedPrimaryServer

When you use the AsReplica parameter to specify a virtual machine as a replica virtual machine, this parameter determines which primary servers can send replication to the replica virtual machine. Replication is accepted only from the server specified in the chosen authentication entry, or any other authentication entry that has the same trust group.

Parameter properties

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

Parameter sets

VMName_AsReplica
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
VMObject_AsReplica
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-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

-AsReplica

Specifies that the virtual machine is a replica virtual machine, enabling it to be used as the source for the initial replication of the primary virtual machine.

Parameter properties

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

Parameter sets

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

-AuthenticationType

Specifies the authentication type to use for virtual machine replication, either Kerberos or Certificate. The specified Replica server must support the chosen authentication type. Run the Get-VMReplicationServer cmdlet to verify the authentication configured for the specified Replica server, or contact the administrator of the specified Replica server.

Parameter properties

Type:ReplicationAuthenticationType
Default value:None
Accepted values:Kerberos, Certificate
Supports wildcards:False
DontShow:False
Aliases:AuthType

Parameter sets

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

-AutoResynchronizeEnabled

Enables replicating virtual machines that require resynchronization to be resynchronized automatically. (For example, a virtual machine requires resynchronization if the primary server shuts down abruptly). Resynchronization requires significant storage and processing resources. We recommended scheduling resynchronization during off-peak hours to reduce the impact to the host and other virtual machines running on the host. Use the AutoResynchronizeIntervalStart and AutoResynchronizeIntervalEnd parameters to specify an off-peak time to start the automatic resynchronization.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AutoResync

Parameter sets

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

-AutoResynchronizeIntervalEnd

Specifies the end of the time period in which you want resynchronization to start automatically.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AutoResyncEnd

Parameter sets

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

-AutoResynchronizeIntervalStart

Specifies the start of the time period in which you want resynchronization to start automatically.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AutoResyncStart

Parameter sets

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

-BypassProxyServer

Specifies whether to bypass a proxy server while replicating data to the Replica server.

Parameter properties

Type:Boolean
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
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertificateThumbprint

Specifies the certificate to use for mutual authentication of the replication data. This parameter is required only when "Certificate" is specified as the type of authentication. Specify the thumbprint of a valid computer certificate from the Personal store.

The certificate must have all of the following properties to be valid:

  • It must not be expired.
  • It must include both client and server authentication extensions for extended key usage (EKU), and an associated private key.
  • It must terminate at a valid root certificate.

The requirement for the subject common name (CN) differs depending on whether the virtual machine belongs to a cluster. For virtual machines that do not belong to a cluster, the subject common name (CN) must be equal to, or subject alternative name (DNS Name) should contain, the FQDN of the host. For virtual machines that belong to a cluster, the subject common name (CN) must be equal to, or subject alternative name (DNS Name) must contain, the and fully qualified ___domain name (FQDN) of the Hyper-V Replica Broker.

To display a list of certificates in the computer's My store and the thumbprint of each certificate, type the following:

PS C:\\\> cd cert:\LocalMachine\My

PS C:\\\> dir | format-list

For more information about certificate stores, see http://technet.microsoft.com//library/cc757138.aspx.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Thumbprint, Cert

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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

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

-CompressionEnabled

Specifies whether to compress replication data for this virtual machine when it is sent over the network.

Parameter properties

Type:Boolean
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
VMObject
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 that have the virtual machines for which you want to enable replication. NetBIOS names, IP addresses, and fully qualified ___domain names (FQDN) are allowed. 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
VMName_AsReplica
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

-EnableWriteOrderPreservationAcrossDisks

Determines whether all virtual hard disks selected for replication are replicated to the same point in time. This is useful if the virtual machine runs an application that saves data across virtual hard disks (for example, one virtual hard disk dedicated for application data, and another virtual hard disk dedicated for application log files).

Parameter properties

Type:Boolean
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
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludedVhd

Specifies one or more virtual hard disks to exclude from replication (for example, a virtual hard disk dedicated for the paging file). Be careful not to exclude virtual hard disks that are critical to the virtual machine's ability to start up, such as the virtual hard disk that stores the guest operating system. Excluding a critical disk could prevent the replica virtual machine from starting up properly.

Parameter properties

Type:

HardDiskDrive[]

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
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludedVhdPath

Specifies the fully qualified path names to the virtual hard disks to exclude from replication.

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
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Passthru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

-RecoveryHistory

Specifies whether to store additional recovery points on the replica virtual machine. Storing more than the most recent recovery point of the primary virtual machine allows you to recover to an earlier point in time. However, storing additional recovery points requires more storage and processing resources. You can configure as many as 24 recovery points to be stored.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RecHist

Parameter sets

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

-ReplicaServerName

Specifies the name of the Replica server to which this virtual machine will be replicated.

Parameter properties

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

Parameter sets

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

-ReplicaServerPort

Specifies the port on the Replica server to use for replication traffic. Make sure you specify a port that is configured on the Replica server to support the same authentication type you specify using the AuthenticationType parameter in this cmdlet. Run the Get-VMReplicationServer cmdlet on the Replica server to check the configuration of the port, or contact the administrator of the specified Replica server.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ReplicaPort

Parameter sets

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

-ReplicateHostKvpItems

Specifies whether to replicate host-only key value pairs (KVP) for this virtual machine.

Parameter properties

Type:Boolean
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
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationFrequencySec

Specifies the frequency, in seconds, at which Hyper-V replicates changes to the Replica server.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RepFreq

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
VMObject
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 you want to configure for replication.

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
VMObject_AsReplica
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 you want to configure for replication.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

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

-VSSSnapshotFrequencyHour

Specifies the frequency, in hours, at which Volume Shadow Copy Service (VSS) performs a snapshot backup of the virtual machines. Specify this parameter only if application-consistent replication is enabled for the virtual machines and the value you set for the RecoveryHistory parameter is not zero. The cmdlet sets a value of zero for this parameter if application-consistent replication is disabled. Do not specify this parameter if you are extending replication from the Replica virtual machine.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:VSSFreq

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
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.

Inputs

None

Outputs

None