Stop-ServiceFabricTestCommand
Cancels a running Service Fabric fault operation.
Syntax
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.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Indicates that this cmdlet skips the warning message popup and forces the operation to run.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OperationId
Specifies a unique identifier for the command that this cmdlet cancels. You assign this value when you initiated the command.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
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: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
System.Object