MEA resources in terms of CPU core and memory are hardcoded in MEAD template through image flavor settings. This result in either provisioning MEA for typical usage or for maximum usage. The former leads to service disruption when load exceeds provisioned capacity. And the later leads to underutilized resources and waste during normal system load. So apmec provides a way to seamlessly scale the number of MEAs on demand either manually or automatically.
Apmec defines TOSCA schema for the scaling policy as given below:
tosca.policies.apmec.Scaling:
derived_from: tosca.policies.Scaling
description: Defines policy for scaling the given targets.
properties:
increment:
type: integer
required: true
description: Number of nodes to add or remove during the scale out/in.
targets:
type: list
entry_schema:
type: string
required: true
description: List of Scaling nodes.
min_instances:
type: integer
required: true
description: Minimum number of instances to scale in.
max_instances:
type: integer
required: true
description: Maximum number of instances to scale out.
default_instances:
type: integer
required: true
description: Initial number of instances.
cooldown:
type: integer
required: false
default: 120
description: Wait time (in seconds) between consecutive scaling
operations. During the cooldown period, scaling action will be ignored
Following TOSCA snippet shows the scaling policy used in MEAD, in which vdu1 and vdu2 are already defined VDUs.
policies:
sp1:
type: tosca.policies.apmec.Scaling
description: Simple VDU scaling
properties:
min_instances: 1
max_instances: 3
default_instances: 2
increment: 1
targets: [vdu1, vdu2]
Once OpenStack/Devstack along with Apmec has been successfully installed, deploy a sample scaling template from location given below: https://github.com/openstack/apmec/tree/master/samples/tosca-templates/mead
Refer the ‘Getting Started’ link below on how to create a MEAD and deploy a MEA: https://docs.openstack.org/apmec/latest/install/getting_started.html
Apmec provides following CLI for scaling.
Here,
For example, to scale-out policy ‘sp1’ defined above, this cli could be used as below:
Apmec provides following REST API for scaling.
POST on v1.0/meas/<mea-id>/actions
with body
{“scale”: { “type”: “<type>”, “policy” : “<scaling-policy-name>”}}
Here,
Response http status codes:
During the scaling operation, the MEA will be moving in below state transformations:
Following features are not supported with scaling:
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.