Invoke-ServiceFabricChaosTestScenario

Invoke-ServiceFabricChaosTestScenario

Invokes a test scenario to induce iterative failover and faults in a cluster.

Syntax

Parameter Set: Default
Invoke-ServiceFabricChaosTestScenario [-TimeToRunMinute] <UInt32> [-MaxClusterStabilizationTimeoutSec] <UInt32> [-EnableMoveReplicaFaults] [-MaxConcurrentFaults <UInt32]> ] [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <UInt32]> ] [-WaitTimeBetweenIterationsSec <UInt32]> ] [ <CommonParameters>]

Detailed Description

The Invoke-ServiceFabricChaosTestScenario cmdlet starts a test scenario to induce iterative failover and faults in a Service Fabric cluster. The cmdlet validates the health and availability of all of the services in the cluster before starting the next iteration of failover and faults. Use the MaxConcurrentFaults parameter to specify the maximum number of concurrent faults for each iteration.

If at any time a service is not healthy or is unavailable by the amount of time specified by the MaxClusterStabilizationTimeout parameter, the test fails with a FabricValidationException exception.

The faults are induced in a manner such that the faults do not cause any service or data to become unavailable; however, the chaos test scenario assumes no outside faults are induced or any unexpected failures occur, in which case services or data may become unavailable.

The Invoke-ServiceFabricChaosTestScenario cmdlet helps you to analyze your test or staging clusters to ensure that system faults do not result in loss of data availability or other unexpected service issues.

Before using this cmdlet, connect to the Service Fabric cluster.

Parameters

-EnableMoveReplicaFaults

Indicates that this cmdlet enables move replica faults.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxClusterStabilizationTimeoutSec<UInt32>

Specifies the maximum time-out period, in seconds, for a cluster to stabilize after a fault before failing the test.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxConcurrentFaults<UInt32]>

Specifies the maximum number of concurrent faults.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TimeoutSec<Int32]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TimeToRunMinute<UInt32>

Specifies the total time, in minutes, for the scenario to run.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WaitTimeBetweenFaultsSec<UInt32]>

Specifies the maximum wait time, in seconds, between consecutive faults. The larger the value the lower the concurrency.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WaitTimeBetweenIterationsSec<UInt32]>

Specifies the wait time, in seconds, for the duration between iterations.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • UInt32

    Represents the time to run.

  • UInt32

    Represents the maximum stabilization time, in seconds, for the cluster.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Object

    This cmdlet returns a String object that represents the final status of the test.

Examples

Example 1: Run a chaos test

The first four commands store values in variables to use as parameters. The final command runs the chaos test for 60 minutes with a maximum stabilization time of 180 seconds and three maximum concurrent faults.

PS C:\> $TimeToRun = 60
PS C:\> $MaxStabilizationTimeSecs = 180
PS C:\> $ConcurrentFaults = 3
PS C:\> $WaitTimeBetweenIterationsSec = 60

PS C:\> Invoke-ServiceFabricChaosTestScenario -TimeToRunMinute $TimeToRun -MaxClusterStabilizationTimeoutSec $MaxStabilizationTimeSecs -MaxConcurrentFaults $ConcurrentFaults -EnableMoveReplicaFaults -WaitTimeBetweenIterationsSec $WaitTimeBetweenIterationsSec

Invoke-ServiceFabricFailoverTestScenario