Share via


Disable-ServiceFabricNode

Disables a Service Fabric node.

Syntax

Default (Default)

Disable-ServiceFabricNode
    [-NodeName] <String>
    [-Intent] <NodeDeactivationIntent>
    [-Force]
    [-TimeoutSec <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Disable-ServiceFabricNode cmdlet informs Service Fabric before an administrative action is taken on a node that may affect the replicas on the node.

For example, before restarting a node, disabling the node with intent restart informs Service Fabric to gracefully close the replicas on the node. You must wait for the node to become disabled before restarting the node. Use the Get-ServiceFabricNode cmdlet to view the disabling status of the node. Service Fabric ensures that services stay available even if these replicas are closed. The node stays in the disabling state until it is safe to disable it without affecting service availability. After the restart has been completed, the node can be enabled using the Enable-ServiceFabricNode cmdlet, which informs Service Fabric that the node can now be used for placing replicas.

To manage Service Fabric clusters, start Windows PowerShell by using the Run as administrator option. 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: Deactivate a node with intent restart

PS C:\> Disable-ServiceFabricNode -NodeName "DB.41" -Intent Restart

This command disables a node with node name DB.41 with intent restart.

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

-Intent

Specifies the intent for the disable node. The intent determines the action that Service Fabric takes for the node. The acceptable values for this parameter are:

  • Pause. No new replicas are placed on the node. Existing replicas continue to run. You might specify this setting to debug replicas that run on the node.
  • Restart. Existing replicas on the node are closed. Replicas are not moved to other node. You might specify this setting when a node restart is required for installing a patch.
  • RemoveData. Specifies that the data on the node is to be permanently lost. This cmdlet creates copies of the replicas that run on the node on other nodes to ensure high availability. You might specify this setting when the hard disk is being reimaged.
  • RemoveNode. Specifies that the data on the node is to be permanently lost. This cmdlet creates copies of the replicas that run on the node on other nodes to ensure high availability. You might specify this setting when the node is being removed from the cluster.

Parameter properties

Type:NodeDeactivationIntent
Default value:None
Accepted values:Invalid, Pause, Restart, RemoveData, RemoveNode
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

-NodeName

Specifies the name of a Service Fabric node. The cmdlet disables the node that you specify.

Parameter properties

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

Parameter sets

(All)
Position:0
Mandatory:True
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