Modifier

Partager via


Stop-VMFailover

Stops failover of a virtual machine.

Syntax

Stop-VMFailover
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-VMName] <String[]>
    [-AsJob]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Stop-VMFailover
    [-VM] <VirtualMachine[]>
    [-AsJob]
    [-Passthru]
    [-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.

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

-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.

Type:CimSession[]
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:None
Required:False
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

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

Type:PSCredential[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Passthru

Specifies that an object is to be passed through to the pipeline representing the virtual machine whose initial replication 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:0
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:0
Default value:None
Required:True
Accept pipeline input:True
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

None

Default

Microsoft.HyperV.PowerShell.VirtualMachine

If -PassThru is specified.