Get-​Service​Fabric​Partition​Health

Gets the health of a Service Fabric partition.

Syntax

Get-ServiceFabricPartitionHealth
   [-PartitionId] <Guid>
   [-ConsiderWarningAsError <Boolean>]
   [-EventsFilter <HealthStateFilter>]
   [-EventsHealthStateFilter <Int64>]
   [-MaxPercentUnhealthyReplicasPerPartition <Byte>]
   [-ReplicasFilter <HealthStateFilter>]
   [-ReplicasHealthStateFilter <Int64>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricPartitionHealth cmdlet gets the health of a Service Fabric partition. If you specify a partition that does not exist in the health store, this cmdlet returns an error.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Get the health events for of a service partition

PS C:\> $ToDoPartition01 = Get-ServiceFabricPartition -ServiceName fabric:/myapp/persistenttodolist/svc1PS
PS C:\> Get-ServiceFabricPartitionHealth -PartitionId $ToDoPartition01.PartitionId

The first command uses the Get-ServiceFabricPartition cmdlet to get the singleton service partition object for the specified service, and then stores the object in the $ToDoPartition01 variable.

The second command gets the health of the partition by using the PartitionId property of the object stored in $ToDoPartition01.

Example 2: Query the health of a service partition using custom health policy and return filters

PS C:\> Get-ServiceFabricPartition -ServiceName fabric:/myapp/persistenttodolist/svc1PS | Get-ServiceFabricPartitionHealth -ConsiderWarningAsError $True -EventsFilter Error

This command queries the health of the partitions of the specified service. It uses custom health policy and filter to return only Error events.

Required Parameters

-PartitionId

Specifies the ID of a Service Fabric partition.

Type:Guid
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ConsiderWarningAsError

Indicates whether to treat a warning health report as error during health evaluation.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsFilter

Specifies the filter for the collection of HealthEvents reported on the partition based on health state. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only events that match the filter are returned. All events are used to evaluate the partition's aggregated health state. If not specified, all entries are returned.

Type:HealthStateFilter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsHealthStateFilter

This parameter has been deprecated. Specify the EventsFilter parameter instead.

Type:Int64
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxPercentUnhealthyReplicasPerPartition

Specifies the maximum tolerated percentage of unhealthy replicas in a partition. If there are more replicas with a health state error than tolerated, the health state of the partition is error.

Type:Byte
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ReplicasFilter

Specifies the filter for ReplicaHealthState children based on health state. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only children that match the filter are returned. All children are used to evaluate the entity aggregated health state. If not specified, all entries are returned.

Type:HealthStateFilter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ReplicasHealthStateFilter

This parameter has been deprecated. Specify the ReplicasFilter parameter instead.

Type:Int64
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Guid

This cmdlet accepts the ID of a Service Fabric partition.

Outputs

System.Object

This cmdlet returns a System.Fabric.Health.PartitionHealth object that represents the health of a Service Fabric partition.