Stop-VMFailover

Stops failover of a virtual machine.

Syntax

Stop-VMFailover
    [-VMName] <String[]>
    [-AsJob]
    [-ComputerName <String[]>]
    [-PassThru]
Stop-VMFailover
    [-VM] <VirtualMachine[]>
    [-AsJob]
    [-PassThru]

Description

The Stop-VMFailover cmdlet stops failover of a virtual machine. If the virtual machine is running, this cmdlet turns the virtual machine off and cancels failover. For a test failover, this cmdlet stops the test failover and deletes the test virtual machine. For a planned failover that has been started on a primary virtual machine, this cmdlet cancels that action and restarts replication, which allows you to start the primary virtual machine.

Examples

Example 1

PS C:\> Stop-VMFailover VM01

This example stops failover for a virtual machine named VM01.

Example 2

PS C:\> Stop-VMFailover *

This example stops all running failovers for all the virtual machines on the local Hyper-V host.

Parameters

-AsJob

Runs the cmdlet as a background job.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies one or more hosts on which to cancel the failover of a virtual machine. 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.

Type:String[]
Position:Named
Default value:.
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VM

Specifies the virtual machine whose failover you want to cancel.

Type:VirtualMachine[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMName

Specifies the name of the virtual machine whose you want to cancel.

Type:String[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:True

Outputs

None

Default

Microsoft.Virtualization.Powershell.VirtualMachine

If -PassThru is specified.