Update-​Service​Fabric​Service​Group

Updates a Service Fabric service group.

Syntax

Update-ServiceFabricServiceGroup
      [-Stateless]
      [-ServiceName] <Uri>
      [-Force]
      [-InstanceCount <Int32>]
      [-TimeoutSec <Int32>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]
Update-ServiceFabricServiceGroup
      [-Stateful]
      [-ServiceName] <Uri>
      [-Force]
      [-MinReplicaSetSize <Int32>]
      [-QuorumLossWaitDuration <TimeSpan>]
      [-ReplicaRestartWaitDuration <TimeSpan>]
      [-TargetReplicaSetSize <Int32>]
      [-TimeoutSec <Int32>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

Description

The Update-ServiceFabricServiceGroup cmdlet updates a Service Fabric service group.

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: Update a stateful service group

PS C:\> Update-ServiceFabricServiceGroup -Stateful -ServiceName fabric:/myapp/test -MinReplicaSetSize 3 -TargetReplicaSetSize 5

This command updates the minimum replica set size and the target replica set size of a running Fabric Service to three (3) and five (5).

Example 2: Update a stateless service group

PS C:\> Update-ServiceFabricServiceGroup -Stateless -ServiceName fabric:/myapp/test -InstanceCount -1

This command updates the instance count of a running Fabric Service to a value of negative one (-1).

Required Parameters

-ServiceName

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

Type:Uri
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Stateful

Indicates that the service is a Service Fabric stateful service.

Type:SwitchParameter
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Stateless

Indicates that the service is a Service Fabric stateless service.

Type:SwitchParameter
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstanceCount

Specifies the number of instances for the stateless service.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MinReplicaSetSize

Specifies the minimum replica set size for the Service Fabric stateful service.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-QuorumLossWaitDuration

Specifies the duration, as a TimeSpan object, that Service Fabric waits before it declares data loss for a service partition. To obtain a TimeSpan object, use the New-TimeSpan cmdlet. For more information, type Get-Help New-TimeSpan.

Type:TimeSpan
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ReplicaRestartWaitDuration

Specifies the interval, as a TimeSpan object, that Service Fabric waits for the replica to restart before it fails over the replica. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

Type:TimeSpan
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetReplicaSetSize

Specifies the target replica set size for a Service Fabric stateful service.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object