Start-​Service​Fabric​Node​Transition

Initiates an operation to start or stop a Service Fabric cluster node.

Syntax

Start-ServiceFabricNodeTransition
     -NodeInstanceId <BigInteger>
     -NodeName <String>
     -OperationId <Guid>
     [-Start]
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricNodeTransition
     -NodeInstanceId <BigInteger>
     -NodeName <String>
     -OperationId <Guid>
     [-Stop]
     -StopDurationInSeconds <Int32>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]

Description

The Start-ServiceFabricNodeTransition cmdlet initiates an asynchronous operation to start or stop a Service Fabric cluster node.

Specifying the Stop parameter puts a Service Fabric cluster node into a stopped state. A node is a process, not a virtual machine or computer. The virtual machine or computer continues to run after the node is stopped. In the stopped state, the node is not a member of the cluster and cannot host services. A stopped node simulates a node that is down or offline.

Specifying the Start parameter starts a node that was stopped.

When this cmdlet returns successfully, the system has accepted the operation. However, this does not imply that the operation has finished. To get information about the current state of the operation, run the Get-ServiceFabricNodeTransitionProgress cmdlet.

The Start-ServiceFabricNodeTransition cmdlet is preferred over the Start-ServiceFabricNode and Stop-ServiceFabricNode cmdlets, which are obsolete. Avoid mixing usage of this cmdlet with Start-ServiceFabricNode and Stop-ServiceFabricNode. If a node is has already been stopped by using Stop-ServiceFabricNode, start it using Start-ServiceFabricNode before using Start-ServiceFabricNodeTransition. Use Start-ServiceFabricNodeTransition from then on.

For more information, see Replacing the Start Node and Stop node APIs with the Node Transition API (https://docs.microsoft.com/azure/service-fabric/service-fabric-node-transition-apis).

Examples

Example 1: Stop a Service Fabric node

PS C:\> Start-ServiceFabricNodeTransition -Stop -OperationId 097b03e3-760a-419c-9fce-e83f8cc0894b -NodeName N0050 -NodeInstanceId 131242467532403195 -StopDurationInSeconds 3600

This command initiates an operation to stop a Service Fabric node for one hour. After one hour, the node automatically starts itself. Keep track of the OperationId value. You can use it to run Get-ServiceFabricNodeTransitionProgress.

Example 2: Start a Service Fabric node

PS C:\> Start-ServiceFabricNodeTransition -Start -OperationId 6d1bf9a1-9733-4d83-be59-0acea3be57a7 -NodeName N0050 -NodeInstanceId 131242467532403195

This command initiates an operation to start a stopped Service Fabric node.

Required Parameters

-NodeInstanceId

Specifies ID of the node instance that this cmdlet starts or stops. To obtain node instance IDs, run Get-ServiceFabricNode for the target node. For example, for the node N0050, the command Get-ServiceFabricNode -NodeName "N0050" returns a Node object that contains the node instance ID.

Type:BigInteger
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NodeName

Specifies the name of the Service Fabric node that this cmdlet starts or stops. To obtain Service Fabric nodes in your cluster, run the Get-ServiceFabricNode cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperationId

Specifies a unique ID that identifies the operation. Use the same value for this cmdlet, which initiates the operation, and Get-ServiceFabricNodeTransitionProgress, which gets operation progress.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Start

Indicates that this cmdlet starts a stopped node.

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

Indicates that this cmdlet stops a running node.

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

Specifies the duration, in seconds, to keep a stopped node stopped after the operation to stop is completed. After this time, the node automatically starts.The minimum value is 600. The maximum value is 14400.

You must specify the Stop parameter in order to specify a stop duration.

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

Optional Parameters

-TimeoutSec

Specifies the time-out value, in seconds, for this cmdlet.This is not the length of time that the stopped node remains stopped. To control how long a node is stopped, use the StopDurationInSeconds parameter.

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

Outputs

None