Start-VMFailover

Start-VMFailover

Starts failover on a virtual machine.

Syntax

Parameter Set: VMName
Start-VMFailover [-VMName] <String[]> [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-Passthru] [-Prepare] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMName_Test
Start-VMFailover [-VMName] <String[]> -AsTest [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Start-VMFailover [-VM] <VirtualMachine[]> [-AsJob] [-Passthru] [-Prepare] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject_Test
Start-VMFailover [-VM] <VirtualMachine[]> -AsTest [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMSnapshot
Start-VMFailover [-VMRecoverySnapshot] <VMSnapshot> [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMSnapshot_Test
Start-VMFailover [-VMRecoverySnapshot] <VMSnapshot> -AsTest [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Start-VMFailover cmdlet can be used for the following tasks:

   -- Fail over a Replica virtual machine to a chosen recovery point.

   -- Start a planned failover on a primary virtual machine.

   -- Create a test virtual machine on a Replica virtual machine.

Parameter

-AsJob

Runs the cmdlet as a background job.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-AsTest

Creates a test virtual machine using the chosen recovery point. You can use a test virtual machine to validate a Replica virtual machine. To stop a test failover, use the Stop-VMFailover cmdlet.

Aliase

none

Erforderlich?

true

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which failover 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.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Credential<System.Management.Automation.PSCredential[]>

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

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Passthru

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

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Prepare

Starts the planned failover on the primary virtual machine and replicates any pending changes. To complete the planned failover, use the Set-VMReplication and Start-VM cmdlets as shown in Example 4.

Note: The primary virtual machine must be shut down to prepare it for failover.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-VM<VirtualMachine[]>

Specifies the virtual machine for which failover is to be started.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-VMName<String[]>

Specifies the name of the virtual machine for which failover is to be started.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-VMRecoverySnapshot<VMSnapshot>

Specifies the recovery snapshot to use during a failover. (This parameter is not required for a planned failover.)

Aliase

VMRecoveryCheckpoint

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-Confirm

Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • None by default; Microsoft.HyperV.PowerShell.VirtualMachine if –PassThru is specified.

Beispiele

Example 1

This example starts failover of a virtual machine named VM01 with recovery point Snapshot01.

Note: Recovery points are stored as snapshots. To get a list of all snapshots, use the Get-VMSnapshot cmdlet.

PS C:\> Get-VMSnapshot VM01 –Name Snapshot01 | Start-VMFailover

Example 2

This example starts a test failover of a virtual machine named VM01.

PS C:\> Start-VMFailover VM01 -AsTest

Example 3

Starts a test failover of a virtual machine named VM01 with recovery point Snapshot01.

PS C:\> Get-VMSnapshot VM01 –Name Snapshot01 | Start-VMFailover -AsTest

Example 4

This example shows the cmdlets you use to perform a planned failover. The first command prepares for the planned failover of a primary virtual machine named VM01 by replicating any pending changes. The second command fails over the Replica virtual machine. The third command switches the Replica virtual machine to a primary virtual machine. The fourth command starts the virtual machine that has been switched from a Replica virtual machine to a primary virtual machine.

PS C:\> Start-VMFailover –Prepare –VMName VM01  -computername MyPrimary.contoso.com
PS C:\> Start-VMFailover –VMName VM01 –computername MyReplica.contoso.com
PS C:\> Set-VMReplication –Reverse –VMName VM01 –computername MyReplica.contoso.com
PS C:\> Start-VM –VMName VM01 –computername MyReplica.contoso.com