Restart-ServiceFabricDeployedCodePackage
Restarts a code package deployed on a node in a cluster to simulate a process failure.
Syntax
ByNodeName
Restart-ServiceFabricDeployedCodePackage
[-NodeName] <String>
[-ApplicationName] <Uri>
[-ServiceManifestName] <String>
[-CodePackageName] <String>
[[-CodePackageInstanceId] <Int64>]
[-ServicePackageActivationId <String>]
[-CommandCompletionMode <CompletionMode>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
PartitionId
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-PartitionId <Guid>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
PartitionIdReplicaPrimary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-PartitionId <Guid>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-ReplicaKindPrimary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
PartitionIdReplicaRandomSecondary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-PartitionId <Guid>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-ReplicaKindRandomSecondary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
PartitionIdReplicaId
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-PartitionId <Guid>
-ServiceName <Uri>
-ReplicaOrInstanceId <Int64>
[-CommandCompletionMode <CompletionMode>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceName
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingleton
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindSingleton]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamed
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindNamed]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindUniformInt64]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingletonReplicaRandomSecondary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindSingleton]
[-ReplicaKindRandomSecondary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamedReplicaRandomSecondary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindNamed]
[-ReplicaKindRandomSecondary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindUniformInt64]
[-ReplicaKindRandomSecondary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingletonReplicaPrimary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindSingleton]
[-ReplicaKindPrimary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamedReplicaPrimary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindNamed]
[-ReplicaKindPrimary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindUniformInt64]
[-ReplicaKindPrimary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingletonReplicaId
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-ReplicaOrInstanceId <Int64>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindSingleton]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamedReplicaId
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
-ReplicaOrInstanceId <Int64>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindNamed]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-PartitionKey <String>
-ReplicaOrInstanceId <Int64>
[-CommandCompletionMode <CompletionMode>]
[-PartitionKindUniformInt64]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNameReplicaPrimary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-ReplicaKindPrimary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNameReplicaRandomSecondary
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
[-CommandCompletionMode <CompletionMode>]
[-ReplicaKindRandomSecondary]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNameReplicaId
Restart-ServiceFabricDeployedCodePackage
[-ApplicationName] <Uri>
-ServiceName <Uri>
-ReplicaOrInstanceId <Int64>
[-CommandCompletionMode <CompletionMode>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
The Restart-ServiceFabricDeployedCodePackage cmdlet ends the code package process, which restarts all of the user service replicas hosted in that process.
This restart simulates code package process failures in the cluster, which tests the failover recovery paths of your service.
You can specify a code package, or you can specify a ReplicaSelector to restart the node and code package combination where the replica is hosted.
This simplifies tests on the primary host node by not having to determine which Service Fabric node is the primary node before restarting that node.
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: Restart a code package for a random secondary replica
PS C:\> Restart-ServiceFabricDeployedCodePackage -ReplicaKindRandomSecondary -PartitionKindSingleton -ServiceName fabric:/SampleApp/SampleService -ApplicationName fabric:/SampleApp -CommandCompletionMode Verify
This command restarts a code package for a random secondary replica on a singleton partition.
Example 2: Restart a specified code package
PS C:\> Restart-ServiceFabricDeployedCodePackage -NodeName "Node01" -ApplicationName fabric:/App -CodePackageName "CodePackage01" -ServiceManifestName "ServiceManifest01" -CommandCompletionMode Verify
This command restarts the code package named CodePackage01 from the service manifest named ServiceManifest01 on the node named Node01.
Parameters
-ApplicationName
Specifies the name of the application to which the code package belongs.
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: True
Value from remaining arguments: False
-CodePackageInstanceId
Specifies the instance ID of the code package that is checked against the deployed one before restarting.
If you specify 0, no comparison is done.
Parameter properties
Type: Int64
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByNodeName
Position: 4
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-CodePackageName
Specifies the name of the code package to restart.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByNodeName
Position: 3
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-CommandCompletionMode
Specifies whether the action waits for the restart to complete.
Parameter properties
Type: CompletionMode
Default value: None
Accepted values: Invalid, DoNotVerify, Verify
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
-NodeName
Specifies the name of a Service Fabric node.
The cmdlet restarts the node you specify.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByNodeName
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PartitionId
Specifies the ID of the partition for which the code package is restarted.
Parameter properties
Type: Guid
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PartitionKey
Specifies the key of the partition for which the code package is restarted.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionNamed
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedInt
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PartitionKindNamed
Indicates that this cmdlet restarts a code package on a named partition.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionNamed
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PartitionKindSingleton
Indicates that this cmdlet restarts a code package on a singleton partition.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionSingleton
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Indicates that this cmdlet restarts a code package on a UniformInt64 partition.
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
ServiceNamePartitionUniformedInt
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReplicaKindPrimary
Indicates that this cmdlet restarts the code package for the primary replica.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionIdReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNameReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReplicaKindRandomSecondary
Indicates that this cmdlet restarts a code package for a random secondary replica.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionIdReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ServiceNameReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReplicaOrInstanceId
Specifies a Service Fabric service replica or instance ID.
Parameter properties
Type: Int64
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionIdReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNameReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ServiceManifestName
Specifies the name of the service manifest where the code package is defined.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByNodeName
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ServiceName
Specifies the name of the service to which the code package belongs.
Parameter properties
Type: Uri
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
PartitionIdReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionSingleton
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamed
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedInt
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionSingletonReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionNamedReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedIntReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNameReplicaPrimary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNameReplicaRandomSecondary
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNameReplicaId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ServicePackageActivationId
The activation id of the deployed ServicePackage which contain the CodePackage . This can be obtained by using the query Get-ServiceFabricDeployedCodePackage .
If ServicePackageActivationMode specified at the time of creating the service (using New-ServiceFabricService
) is SharedProcess (or if it is not specified, in which case it defaults to SharedProcess ), then value of ServicePackageActivationId is always an empty string and need not be specified. To learn more about service package activation id, please see [Service Fabric Hosting Model][1].
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByNodeName
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
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
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 .
System.String
System.Uri
System.Nullable`1
System.Guid
Outputs
System.Object