-
Notifications
You must be signed in to change notification settings - Fork 2
MELA Application Specific Configuration
MELA provides RESTful services for configuring it for a particular application, and thus all MELA configurations can be done through service calls.
MELA considers any cloud application as a service, and uses a representational model which divides Cloud Services in Service Topologies, which are composed of Service Units, which run in Virtual Machines members of Virtual Clusters. In Listing 1 we show an application description example, which describes a CloudService having two topologies, a DataEndServiceTopology and an EventProcessingServiceTopology. The topologies are just logical concepts, and have no physical equivalent. Each topology has Service Units. The application description must be submitted to MELA issuing a “PUT” request towards the MELA “/servicedescription” service.
Listing 1: Application Structure Description Example
<MonitoredElement id="CloudService" level="SERVICE">
<MonitoredElement id="DataEndServiceTopology" level="SERVICE_TOPOLOGY">
<MonitoredElement id="DataControllerServiceUnit" level="SERVICE_UNIT"/>
<MonitoredElement id="DataNodeServiceUnit" level="SERVICE_UNIT"/>
</MonitoredElement>
<MonitoredElement id="EventProcessingServiceTopology" level="SERVICE_TOPOLOGY">
<MonitoredElement id="LoadBalancerServiceUnit" level="SERVICE_UNIT"/>
<MonitoredElement id="EventProcessingServiceUnit" level="SERVICE_UNIT"/>
</MonitoredElement>
</MonitoredElement>'
The second important configuration step is the specification of metric composition rules, issuing a “PUT” request towards the MELA “/metricscompositionrules” service. In Listing 2 we show a composition rule example, which applies a SUM operation over the “numberOfVMs” metric collected from all the Virtual Machine instances belonging to any Service unit, and creates a new metric also called “numberOfVMs” which will be associated with the Service Unit for which is computed.
<CompositionRulesConfiguration>
<MetricsCompositionRules>
<CompositionRule TargetMonitoredElementLevel="SERVICE_UNIT">
<ResultingMetric type="RESOURCE" measurementUnit="number" name="numberOfVMs"/>
<Operation MetricSourceMonitoredElementLevel="VM" type="SUM">
<ReferenceMetric type="RESOURCE" name="numberOfVMs"/>
</Operation>
</CompositionRule>
</MetricsCompositionRules>
</CompositionRulesConfiguration>
A composition rule applies a set of composition operations over a set of operands.
-
For a composition rule one must first specify the “ResultingMetric”, i.e. the type (RESOURCE, COST, QUALITY), name and measurement unit of the Metric resulting from the composition rule.
Example: <ResultingMetric type="RESOURCE" measurementUnit="ms" name="avgResponseTime"/>
-
The “TargetMonitoredElementLevel” must be specified, which defines at WHICH level in the application structure level (SERVICE, SERVICE_TOPOLOGY, SERVICE_UNIT, VIRTUAL_CLUSTER, and VM) the composition rule is applied. If ONLY the “TargetMonitoredElementLevel” is specified, the composition rule will be applied to all instances having the specified level (e.g., to all SERVICE_UNIT instances)
Example: <CompositionRuleTargetMonitoredElementLevel="SERVICE_UNIT">
-
If a list of "TargetMonitoredElementID" are specified, this indicates particular elements from the application structure on which the composition rule will be applied.
Example:
<TargetMonitoredElementID>DataControllerServiceUnit</TargetMonitoredElementID>
<TargetMonitoredElementID>LoadBalancerServiceUnit</TargetMonitoredElementID>
-
The last element is the list of “CompositionOperation” specifications, where we define the composition operation to be applied at the specified “TargetMonitoredElementLevel” over the optionally specified “TargetMonitoredElementID”
-
The metric resulting from applying the composition rule will be added to the monitoring data at the specified “TargetMonitoredElementLevel” and optionally specified “TargetMonitoredElementID”. If no optionally specified “TargetMonitoredElementID” are present, the metric will be added to all elements belonging to the specified level.
A Composition Operation applies an operation over one or more operands, which can be values or metrics. Depending on the operation type, each operation is processed differently.
For a composition operation, an operand can be:
-
A “value”: any statically defined value
Example: <Operation value="100" type="ADD">
-
A “ReferenceMetric” , which indicates that the operation will be applied on value of the ReferenceMetric.
Example: <Operation MetricSourceMonitoredElementLevel="VM" type="AVG"> <ReferenceMetric type="RESOURCE" name="cpuIdle"/> </Operation>
-
For an operation involving a “ReferenceMetric” , one must also specify the “MetricSourceMonitoredElementLevel”, which indicates at which application structure level (SERVICE, SERVICE_TOPOLOGY, SERVICE_UNIT, VIRTUAL_CLUSTER, and VM) the reference metric will be found UNDER the monitored element over which the rule is applied. The “MetricSourceMonitoredElementLevel” can equal the “TargetMonitoredElementLevel”, or indicate any level belonging to the children of the “TargetMonitoredElementLevel”.
Example:
<CompositionRule TargetMonitoredElementLevel="SERVICE_UNIT">
<Operation MetricSourceMonitoredElementLevel="VM" type="AVG">
- For defining which monitored element from the “MetricSourceMonitoredElementLevel“ is considered in extracting metric values, any number of “SourceMonitoredElementID” can be defined.
Example:
<Operation MetricSourceMonitoredElementLevel="SERVICE_UNIT" type="KEEP">
<ReferenceMetric type="RESOURCE" measurementUnit="req/s" name="troughput"/>
<SourceMonitoredElementID>LoadGenerator
- An operation can contain sub-operations, and the values returned by those sub-operations are used by the current operation, in a hierarchical manner.
Example
<Operation value="100" type="ADD">
<Operation value="-1" type="MUL">
<Operation MetricSourceMonitoredElementLevel="VM" type="AVG">
<ReferenceMetric type="RESOURCE" name="cpuIdle"/>
</Operation>
</Operation>
</Operation>
- For any operation, it is important to specify the type, as the operations are processed differently depending on their type
- SUM Intended to sum the values retrieved from a “ReferenceMetric”
Example
<CompositionRuleTargetMonitoredElementLevel="SERVICE_UNIT">
<ResultingMetric type="RESOURCE" measurementUnit="numberOf" name="numberOfVMs"/>
<Operation MetricSourceMonitoredElementLevel="VM" type="SUM">
<ReferenceMetric type="RESOURCE" name="numberOfVMs"/>
</Operation>
</CompositionRule>
-
AVG Applied similar to SUM, extracts the average.
-
MAX / MIN Applied similar to SUM, extracts the maximum or minimum value.
-
DIV/MUL/ADD/SUB Divide, Multiply, Subtract From, Add To, the value of the first operand the value of the second operand
Example
<Operation value="-1" type="MUL">
<Operation MetricSourceMonitoredElementLevel="VM" type="AVG">
<ReferenceMetric type="RESOURCE" name="cpuIdle"/>
</Operation>
</Operation>
- SET_VALUE Used in creating metric values
Example
<CompositionRuleTargetMonitoredElementLevel="VM">
<ResultingMetric type="RESOURCE" measurementUnit="ms" name="numberOfVMs"/>
<Operation value="1" type="SET_VALUE"/>
</CompositionRule>
- CONCAT
- UNION
- KEEP/ KEEP_LAST/ KEEP_FIRST