Disable-ServiceFabricNode

Disables a Service Fabric node.

Syntax

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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required: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
Required:False
Accept pipeline input:False
Accept wildcard characters: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.
Type:NodeDeactivationIntent
Accepted values:Invalid, Pause, Restart, RemoveData, RemoveNode
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NodeName

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

Type:String
Position:0
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

-WhatIf

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

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

Inputs

None

Outputs

System.Object