3. Background
•Why Senlin?
• Heat AutoScaling today is based on AWS design, with gaps
• Heat's mission
• https://github.com/openstack/governance/blob/master/reference/projects.yaml
• it's NOT about autoscaling, NOT about HA, ...
• It's NOT Heat's job to provide new service(s)
• AutoScaling: a new design
• Proposal: https://wiki.openstack.org/wiki/Heat/AutoScaling
• API Design: http://docs.heatautoscale.apiary.io/
• Targeting at many use cases not covered by Heat today
3
To orchestrate composite cloud applications using a declarative
template format through an OpenStack-native ReST API.
4. Overview (Auto-Scaling)
4
h-client h-api h-eng senlin-eng senlin-db
stack_create
asg_create
asg_id
resource_signal
hook_execute
policy_create
policy_id
webhook_create
webhook_url
• create cluster
• create nodes
• create cluster (stack)
• create policy object
• associate policy to cluster
• generate webhook for
policy
• scale cluster by triggering
policy
• policy works by updating
cluster (stack with new
group template)
• (reload LB if needed)
ASG ID is the stack ID
Auto-Scaling with Heat (30,000 ft)
template
(No
change
needed)
6. BPs on reworking autoscaling
BP Priority Description
autoscaling-api-resources high Heat resources invoking AS APIs
as-api-group-resource high ScalingGroup resource wrapping AS API's group functionality
as-api-policy-resource high ScalingPolicy resource wrapping AS API's policy functionality
as-api-webhook-resource high Webhook resource wrapping AS API's execution of webhooks
autoscaling-api-client high A python client for Heat to interact with AS API
autoscaling-api - A separate service for the implementation of autoscaling w/ Heat
as-engine - A separate engine/service for autoscaling support AS API
as-engine-db - A DB dedicated to autoscaling, using schema created in as-lib-db
as-lib - A separate module to be used by the AS service
as-lib-db - A DB for autoscaling bookkeeping
6
BluePrints
8. A Struggle before Senlin Starts
• We chose to work outside Heat
• Our management supports this approach, thus cycles guaranteed
• We see a lot potentials in a standalone service
• We don't have to do everything from scratch
8
Within Heat Outside Heat
Pros Cons Pros Cons
• smooth transition
• strict reviews, thus
better quality
• long (forever?)
code churn
• eventually, a
dedicated service
is needed, and the
pain to switch over
• quick development
• less code churn to
Heat
• high requirements
of skills and cycles
• eventual switch
over, i.e. another
animal to feed in
the OpenStack zoo
9. What Do We Need?
9
Scalable
Load-Balanced
Healthy
Manageable
......
15. policies - deletion [prototype]
15
# Sample deletion policy that can be attached to a cluster.
# The valid values include:
# OLDEST_FIRST, OLDEST_PROFILE_FIRST, YOUNGEST_FIRST, RANDOM
criteria: OLDEST_FIRST
# Whether deleted node should be destroyed
destroy_after_deletion: True
# Length in number of seconds before the actual deletion happens
# This param buys an instance some time before deletion
grace_period: 60
# Whether the deletion will reduce the desired capability of
# the cluster as well.
reduce_desired_capacity: False
16. policies - scaling [implementing]
16
# Sample scaling-in policy
alarm:
type: SENLIN::ALARM::CEILOMETER
properties:
meter: cpu_util
op: lt
threshold: 15
period: 60
evaluations: 1
schedule:
start_time: "2015-05-07T07:00:00Z"
end_time: "2015-06-07T07:00:00Z"
handlers:
- type: webhook
action: SENLIN::ACTION::RESIZE
params:
type: CHANGE_IN_CAPACITY
number: -1
strict: True
credentials:
user: alarmer
password: secrete
- type: email
addresses: [joe@cloud.com]
alarm
• 'alarm' section is optional
• alarm type properties
• 'query' or 'matching_metadata'?
• Monasca alarm?
• other alarm sources?
schedule
• 'schedule' section is optional
• time period for alarms
• 'schedule' when used by itself
implies a scheduled action
action
• a list of operations to perform
• webhooks generated when policy
is attached to a cluster
18. senlin cluster-resize
18
usage: senlin cluster-resize [-c <CAPACITY>] [-a <ADJUSTMENT>] [-p <PERCENTAGE>]
[-t <MIN_STEP>] [-s] [-n MIN] [-m MAX] <CLUSTER>
Positional arguments:
<CLUSTER> Name or ID of cluster to operate on.
Optional arguments:
-c <CAPACITY>, --capacity <CAPACITY>
The desired number of nodes of the cluster.
-a <ADJUSTMENT>, --adjustment <ADJUSTMENT>
A positive integer meaning the number of nodes to add,
or a negative integer indicating the number of nodes
to remove.
-p <PERCENTAGE>, --percentage <PERCENTAGE>
A value that is interpreted as the percentage of size
adjustment. This value can be positive or negative.
-t <MIN_STEP>, --min-step <MIN_STEP>
An integer specifying the number of nodes for
adjustment when <PERCENTAGE> is specified.
-s, --strict A boolean specifying whether the resize should be
performed on a best-effort basis when the new capacity
may go beyond size constraints.
-n MIN, --min-size MIN
New lower bound of cluster size.
-m MAX, --max-size MAX
New upper bound of cluster size. A value of -1
indicates no upper limit on cluster size.