Stop-VMFailover

Stops failover of a virtual machine.

Syntax

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

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.

Required Parameters

-VM

Specifies the virtual machine whose failover you want to cancel.

Type:VirtualMachine[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMName

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

Type:String[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-AsJob

Runs the cmdlet as a background job.

Type:SwitchParameter
Position:Named
Default value:None
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:.
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

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

Outputs

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