Azure-docs: ApplicationManifest isn't helpful

Created on 6 Jul 2018  Â·  10Comments  Â·  Source: MicrosoftDocs/azure-docs

ApplicationManifest documentation isn't very helpful.
What is "MetricB"?
I found out that LoadMetrics is within ServiceTypes->StatelessServiceType, but where is ServiceScalingPolicies?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author doc-enhancement service-fabrisvc triaged

Most helpful comment

Hi,

@josere You are correct, there is a discrepancy between C# and XML in this case. Documentation will be fixed. Thanks for pointing this out.

@senj Here is a complete example of application manifest with auto scaling turned on:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="DemoType" ApplicationTypeVersion="1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="DemoServicePackage" ServiceManifestVersion="1.0.0.0" />
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="DemoService">
      <StatelessService ServiceTypeName="Demo" InstanceCount="2">
        <SingletonPartition />
        <LoadMetrics>
          <LoadMetric Name="MyMetricName" Weight="High" DefaultLoad="75"/>
        </LoadMetrics>
        <ServiceScalingPolicies>
          <ScalingPolicy>
            <AveragePartitionLoadScalingTrigger MetricName="MyMetricName" LowerLoadThreshold="65" UpperLoadThreshold="90" ScaleIntervalInSeconds="100"/>
            <InstanceCountScalingMechanism MinInstanceCount="1" MaxInstanceCount="4" ScaleIncrement="1"/>
          </ScalingPolicy>
        </ServiceScalingPolicies>
      </StatelessService>
    </Service>
  </DefaultServices>
</ApplicationManifest>

This will create a default service that reports metric called "MyMetricName", and that scales based on it.

All 10 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

Great thanks

As per what is MetricB it is just the name of the metric you setting up the autoscale policy for. This could be CPU, Memory, etc. MetricB was just used as an example. I believe in this example it is actually a custom metric:

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-metrics#custom-metrics

ServiceScalingProperties should be under the application manifest

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-autoscaling#setting-auto-scaling-policy

OK but where excactly in appManifest? Because on the root level it doesnt work.
E.g. Load Metrics is under ServiceTypes.StatelessServiceType.

I don't believe these settings are enabled by default. Rather you need to build them into your code if you want to utilize the autoscaling feature.

@masnider @dkkapur would either of you be able to confirm?

average-partition-load-trigger-with-instance-based-scaling mentions "The only mechanism that can be used with this trigger is PartitionInstanceCountScaleMechanism.", but PartitionInstanceCountScaleMechanism is not a valid mechanism. The correct value should be InstanceCountScalingMechanism, correct?

I guess PartitionInstanceCountScaleMechanism is valid in C#, but not in the ApplicationManifest.xml.

Hi,

@josere You are correct, there is a discrepancy between C# and XML in this case. Documentation will be fixed. Thanks for pointing this out.

@senj Here is a complete example of application manifest with auto scaling turned on:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="DemoType" ApplicationTypeVersion="1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="DemoServicePackage" ServiceManifestVersion="1.0.0.0" />
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="DemoService">
      <StatelessService ServiceTypeName="Demo" InstanceCount="2">
        <SingletonPartition />
        <LoadMetrics>
          <LoadMetric Name="MyMetricName" Weight="High" DefaultLoad="75"/>
        </LoadMetrics>
        <ServiceScalingPolicies>
          <ScalingPolicy>
            <AveragePartitionLoadScalingTrigger MetricName="MyMetricName" LowerLoadThreshold="65" UpperLoadThreshold="90" ScaleIntervalInSeconds="100"/>
            <InstanceCountScalingMechanism MinInstanceCount="1" MaxInstanceCount="4" ScaleIncrement="1"/>
          </ScalingPolicy>
        </ServiceScalingPolicies>
      </StatelessService>
    </Service>
  </DefaultServices>
</ApplicationManifest>

This will create a default service that reports metric called "MyMetricName", and that scales based on it.

Great thank you

@MicahMcKittrick-MSFT

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

bityob picture bityob  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments