Share via


Stop-ServiceFabricTestCommand

Cancels a running Service Fabric fault operation.

Syntax

Default (Default)

Stop-ServiceFabricTestCommand
    -OperationId <Guid>
    [-ForceCancel]
    [-Force]
    [-TimeoutSec <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Stop-ServiceFabricTestCommand cmdlet cancels the specified fault operation. Specify the ID of the operation that you provided when you started the fault. The type of faults that can cancelled include Partition Data Loss (Start-ServiceFabricPartitionDataLoss), Partition Quorum Loss (Start-ServiceFabricPartitionQuorumLoss), Partition Restart (Start-ServiceFabricPartitionRestart) and Node State Transition (Start-ServiceFabricNodeTransition)

Under normal conditions i.e. without the Force parameter, this cmdlet first cancels the fault and attempts to clean up state information. As part of this, the fault operation moves into a RollingBack state during the cleanup. Once the cleanup of the fault completes the final state of the command is Cancelled.

Important Note: If Force is true, inconsistent state may be left behind so please use this option with caution. Using the Force flag will move the operation to the Cancelled state skipping cleanup. Only to be used if recommended in case of fault operation getting stuck. Remove-ServiceFabricTestState should be invoked to remove state that may have been left behind.

Examples

Example 1: Cancel an operation

PS C:\> Stop-ServiceFabricTestCommand -OperationId a268cc73-2e30-462b-b3df-3a0d30e5b330

This command cancels an operation that has the OperationId a268cc73-2e30-462b-b3df-3a0d30e5b330.

Parameters

-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

-Force

Indicates that this cmdlet skips the warning message popup and forces the operation to run.

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

-ForceCancel

This flag forces the command to be cancelled. The use of this parameter may leave state information behind. You can specify Force only if the fault operation is already in a state of RollingBack else it is rejected. The fault operation can be in a RollingBack state only if you previously ran the Stop-ServiceFabricTestCommand without Force specified, or if the fault operation rolls back due to a fatal error.

The final state of the command is ForceCancelled.

We do not recommend specifying Force unless the command is not proceeding.

Important Note: TestCommandProgressState.RollingBack indicates the system is cleaning up the internal system state caused by executing the command. The roll back process does not restore data if the fault operation was a call to Start-ServiceFabricPartitionDataLoss. The system will only clean up its internal state from running the command and it will not restore the target partition's data if the command progressed far enough to cause data loss.

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

-OperationId

Specifies a unique identifier for the command that this cmdlet cancels. You assign this value when you initiated the command.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Parameter properties

Type:Int32
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

-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

System.Object