Share via


ServicePlacementPreferPrimaryDomainPolicyDescription Class

Definition

Represents a ServicePlacementPolicyDescription which indicates that the service’s Primary replicas should optimally be placed in a particular domain.

public sealed class ServicePlacementPreferPrimaryDomainPolicyDescription : System.Fabric.Description.ServicePlacementPolicyDescription
type ServicePlacementPreferPrimaryDomainPolicyDescription = class
    inherit ServicePlacementPolicyDescription
Public NotInheritable Class ServicePlacementPreferPrimaryDomainPolicyDescription
Inherits ServicePlacementPolicyDescription
Inheritance
ServicePlacementPreferPrimaryDomainPolicyDescription

Examples

//create the service placement policy
ServicePlacementPreferPrimaryDomainPolicyDescription placementPolicy = new ServicePlacementPreferPrimaryDomainPolicyDescription();
placementPolicy.DomainName = @"fd:\Datacenter1";

//add it to the Stateful Service Description
StatefulServiceDescription ssd = new StatefulServiceDescription();
ssd.PlacementPolicies.Add(placementPolicy);

Remarks

This constraint is usually used with fault domains in scenarios where the Service Fabric cluster is geographically distributed in order to indicate that a service’s primary replica should be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica may not end up located in this domain due to failures, capacity limits, or other constraints.

Constructors

ServicePlacementPreferPrimaryDomainPolicyDescription()

initializing a new instance of the ServicePlacementPreferPrimaryDomainPolicyDescription class.

Properties

DomainName

Gets or sets the string name of the domain in which the Primary replica should be preferentially located.

Type

Gets the service placement policy type.

(Inherited from ServicePlacementPolicyDescription)

Methods

ToString()

Return a string representation of the PreferPrimaryDomain Service Placement Policy in the form 'PreferPrimaryDomain, DomainName'

Applies to