Add-ServiceFabricConfigurationParameterOverrides

Adds one or more temporary configuration override(s) to the specified cluster node.

Syntax

Add-ServiceFabricConfigurationParameterOverrides
   -NodeName <String>
   -ConfigParameterOverrideList <System.Collections.Generic.List`1[System.Fabric.Description.ConfigParameterOverride]>
   [-Force]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

Dynamic node configuration parameters can be temporarily changed, though some require the -Force flag, as they are generally unsafe to change. Only parameters with simple types can be overridden; complex type parameters are not overridable.

Examples

Example 1: Enable the command in the cluster manifest

This command is disabled by default. Enable it by adding the following dynamic configuration parameter to the cluster manifest:

<Section Name="Testability">
    <Parameter Name="AllowConfigurationOverrides" Value="true" />
</Section>

Example 2: Add override to config parameter for placement / load balancing

$timeout = New-TimeSpan -Hours 3 -Minutes 30
$configOverride = New-Object -TypeName System.Fabric.Description.ConfigParameterOverride(
    "PlacementAndLoadBalancing",
    "DummyPLBEnabled",
    "True",
    $timeout)
$configOverrideList = New-Object 'System.Collections.Generic.List[System.Fabric.Description.ConfigParameterOverride]'
$configOverrideList.Add($configOverride)
Add-ServiceFabricConfigurationParameterOverrides -NodeName DB.0 -ConfigParameterOverrideList $configOverrideList [-Force]

Example 3: Add config overrides to each node

Get-ServiceFabricNode | ForEach-Object {Add-ServiceFabricConfigurationParameterOverrides -NodeName $_.NodeName -ConfigParameterOverrideList $confOverrideList}

Example 4: Verify an override was successfully applied to a node

To verify an override was successfully applied to the node, either call the Get-ServiceFabricConfigurationOverrides command or check the ConfigurationOverride.xml file on the node, for example:

<Settings xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Section Name="PlacementAndLoadBalancing">
    <Parameter SectionName="PlacementAndLoadBalancing" Name="MoveParentToFixAffinityViolation" Value="True" Timeout="2019-11-20 14:33:24.326" PersistAcrossUpgrade="false" IsEncrypted="false" Type="" />
  </Section>
</Settings>

Parameters

-ConfigParameterOverrideList

List of objects specifying the SectionName, ParameterName, and ParameterValue (and optional timeout value, see Example 1) for each desired configuration override.

The optional timeout value specifies the duration of the override. Default is 1 day; maximum duration is 7 days.

Type:System.Collections.Generic.List`1[System.Fabric.Description.ConfigParameterOverride]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces configuration parameters that are otherwise non-overridable to be overriden. Parameters requiring this flag are generally unsafe to change.

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

-NodeName

Name of the cluster node to which the configuration override will apply.

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

Inputs

None

Outputs

System.Object