Start-ServiceFabricPartitionRestart

Initiates the restart of a stateful service partition.

Syntax

Start-ServiceFabricPartitionRestart
     -OperationId <Guid>
     -RestartPartitionMode <RestartPartitionMode>
     -PartitionId <Guid>
     -ServiceName <Uri>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionRestart
     -OperationId <Guid>
     -RestartPartitionMode <RestartPartitionMode>
     -ServiceName <Uri>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionRestart
     -OperationId <Guid>
     -RestartPartitionMode <RestartPartitionMode>
     -ServiceName <Uri>
     [-PartitionKindSingleton]
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionRestart
     -OperationId <Guid>
     -RestartPartitionMode <RestartPartitionMode>
     -ServiceName <Uri>
     [-PartitionKindNamed]
     -PartitionKey <String>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionRestart
     -OperationId <Guid>
     -RestartPartitionMode <RestartPartitionMode>
     -ServiceName <Uri>
     [-PartitionKindUniformInt64]
     -PartitionKey <String>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]

Description

The Start-ServiceFabricPartitionRestart cmdlet initiates the restart of a stateful service partition in Azure Service Fabric. To run this cmdlet, FaultAnalysisService must be enabled.

Run this cmdlet to restart only partitions for stateful services. Do not use this cmdlet to restart partitions for system services.

You can check the progress of the operation by using the Get-ServiceFabricPartitionRestartProgress cmdlet.

Examples

Example 1: Restart all replicas of a service by partition ID

PS C:\> Start-ServiceFabricPartitionRestart -OperationId 53ba886b-79be-46ee-bf7e-d79db64eb003 -RestartPartitionMode AllReplicasOrInstances -PartitionId 20a726d0-3112-4c5a-a22c-2e4b8ee85280 -ServiceName "fabric:/ContosoApp/ContosoService"

This command restarts all replicas of the service named fabric:/ContosoApp/ContosoService in the partition that has the ID 20a726d0-3112-4c5a-a22c-2e4b8ee85280. Specify a unique GUID for the OperationId parameter. You can use this ID to check the progress of the restart operation.

Example 2: Restart all replicas of a service by partition key

PS C:\> Start-ServiceFabricPartitionRestart -OperationId ebd322c2-b1d3-46a7-b254-3cc42e6ca2d1 -RestartPartitionMode AllReplicasOrInstances -ServiceName "fabric:/ContosoApp/ContosoService" -PartitionKindUniformInt64 -PartitionKey 2000

This command restarts all replicas of the service named fabric:/ContosoApp/ContosoService in the partition that has the partition key 2000. Specify a unique GUID for the OperationId parameter.

Parameters

-OperationId

Specifies a unique identifier for this operation. Specify a unique value. You can check the progress of the operation by using this ID and the Get-ServiceFabricPartitionRestartProgress cmdlet.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PartitionId

Specifies the ID of the Service Fabric partition that this cmdlet restarts.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PartitionKey

Specifies the key of the Service Fabric partition that this cmdlet restarts.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PartitionKindNamed

Indicates that the Service Fabric partition that this cmdlet restarts is a Named partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PartitionKindSingleton

Indicates that the Service Fabric partition that this cmdlet restarts is a singleton partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PartitionKindUniformInt64

Indicates that the Service Fabric partition that this cmdlet restarts is a UniformInt64 partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RestartPartitionMode

Specifies the mode for the partition restart operation. The acceptable values for this parameter are:

  • AllReplicasOrInstances. Restart all replicas in the target partition.
  • OnlyActiveSecondaries. Restart only the secondaries in the target partition.
Type:RestartPartitionMode
Accepted values:Invalid, AllReplicasOrInstances, OnlyActiveSecondaries
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceName

Specifies the Uniform Resource Identifier (URI) of a Service Fabric service.

Type:Uri
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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

Inputs

System.Guid

System.Uri

System.String

Outputs

System.Object