Share via


Update-ServiceFabricServiceGroup

Updates a Service Fabric service group.

Syntax

Stateless (Default)

Update-ServiceFabricServiceGroup
    [-ServiceName] <Uri>
    [-Stateless]
    [-InstanceCount <Int32>]
    [-Force]
    [-TimeoutSec <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Stateful

Update-ServiceFabricServiceGroup
    [-ServiceName] <Uri>
    [-Stateful]
    [-TargetReplicaSetSize <Int32>]
    [-MinReplicaSetSize <Int32>]
    [-ReplicaRestartWaitDuration <TimeSpan>]
    [-QuorumLossWaitDuration <TimeSpan>]
    [-Force]
    [-TimeoutSec <Int32>]
    [-WhatIf]
    [-Confirm]
    [<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).

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InstanceCount

Specifies the number of instances for the stateless service.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateless
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MinReplicaSetSize

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateful
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateful
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateful
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServiceName

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

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Stateful

Indicates that the service is a Service Fabric stateful service.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateful
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Stateless

Indicates that the service is a Service Fabric stateless service.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateless
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetReplicaSetSize

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Stateful
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSec

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

None

Outputs

System.Object