Sample scaling policies
This patch replaces the existing complex policy specification with smaller and flexible policy files. Change-Id: Ib3e9e041f6d6042333fbbcf024660db3a76a44a0
This commit is contained in:
parent
afd4259b8d
commit
a3f6b0325c
|
@ -0,0 +1,34 @@
|
|||
# Sample scaling policy that can be attached to a cluster
|
||||
# This policy scales out a cluster when a threshold alarm on ceilometer
|
||||
# reaches alarm state
|
||||
|
||||
policy_type: ScalingPolicy
|
||||
version: 1.0
|
||||
|
||||
alarm:
|
||||
type: SENLIN::ALARM::CEILOMETER
|
||||
properties:
|
||||
meter: cpu_util
|
||||
op: lt
|
||||
threshold: 15
|
||||
period: 60
|
||||
evaluations: 1
|
||||
repeat: True
|
||||
|
||||
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
|
||||
strategy: BEST_EFFORT
|
||||
credentials:
|
||||
user: john
|
||||
password: secrete
|
||||
- type: email
|
||||
addresses:
|
||||
- joe@cloud.com
|
|
@ -0,0 +1,24 @@
|
|||
# Sample scaling policy that can be attached to a cluster
|
||||
# This policy scales out a cluster when a threshold alarm on monasca
|
||||
# reaches alarm state
|
||||
# This is just an example, need monasca alarm driver to work
|
||||
|
||||
type: ScalingPolicy
|
||||
version: 1.0
|
||||
|
||||
alarm:
|
||||
type: SENLIN::ALARM::MONASCA
|
||||
properties:
|
||||
expression: "cpu<10"
|
||||
match_by: "match_condition"
|
||||
severity: medium
|
||||
|
||||
handlers:
|
||||
- type: webhook
|
||||
action: SENLIN::ACTION::RESIZE
|
||||
params:
|
||||
type: CHANGE_IN_CAPACITY
|
||||
number: -1
|
||||
credentials:
|
||||
user: john
|
||||
password: secrete
|
|
@ -0,0 +1,34 @@
|
|||
# Sample scaling policy that can be attached to a cluster
|
||||
# This policy scales out a cluster when a threshold alarm on ceilometer
|
||||
# reaches alarm state
|
||||
|
||||
type: ScalingPolicy
|
||||
version: 1.0
|
||||
|
||||
alarm:
|
||||
type: SENLIN::ALARM::CEILOMETER
|
||||
properties:
|
||||
meter: cpu_util
|
||||
op: gt
|
||||
threshold: 50
|
||||
period: 60
|
||||
evaluations: 1
|
||||
repeat: True
|
||||
|
||||
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
|
||||
strategy: BEST_EFFORT
|
||||
credentials:
|
||||
user: john
|
||||
password: secrete
|
||||
- type: email
|
||||
addresses:
|
||||
- joe@cloud.com
|
|
@ -1,57 +0,0 @@
|
|||
# Sample scaling policy that can be attached to a cluster
|
||||
|
||||
constraints:
|
||||
# Min number of nodes to keep the cluster operational
|
||||
min_size: 1
|
||||
|
||||
# Max number of nodes to cap resource consumption
|
||||
max_size: 10
|
||||
|
||||
policies:
|
||||
- condition:
|
||||
# name of meter for testing
|
||||
meter: cpu_util
|
||||
# comparison operator, valid values include 'lt', 'gt', 'eq'
|
||||
op: gt
|
||||
# Threshold for testing
|
||||
threshold: 50
|
||||
# Length of each evaluation period in seconds
|
||||
period: 60
|
||||
# Number of evaluations to perform
|
||||
evaluations: 1
|
||||
adjustment:
|
||||
# Adjustment type, valid values include:
|
||||
# EXACT_CAPACITY, CHANGE_IN_CAPACITY, CHANGE_IN_PERCENTAGE
|
||||
type: CHANGE_IN_CAPACITY
|
||||
|
||||
# A number that will be interpreted based on the type setting
|
||||
number: 1
|
||||
|
||||
# When type is set CHNAGE_IN_PERCENTAGE, min_step specifies
|
||||
# that the cluster size will be changed by at least the number
|
||||
# of nodes specified here
|
||||
min_step: 1
|
||||
|
||||
- condition:
|
||||
# name of meter for testing
|
||||
meter: cpu_util
|
||||
# comparison operator, valid values include 'lt', 'gt', 'eq'
|
||||
op: lt
|
||||
# Threshold for testing
|
||||
threshold: 15
|
||||
# Length of each evaluation period in seconds
|
||||
period: 60
|
||||
# Number of evaluations to perform
|
||||
evaluations: 1
|
||||
adjustment:
|
||||
# Adjustment type, valid values include:
|
||||
# EXACT_CAPACITY, CHANGE_IN_CAPACITY, CHANGE_IN_PERCENTAGE
|
||||
type: CHANGE_IN_CAPACITY
|
||||
|
||||
# A number that will be interpreted based on the type setting
|
||||
number: 1
|
||||
|
||||
# When type is set CHNAGE_IN_PERCENTAGE, min_step specifies
|
||||
# that the cluster size will be changed by at least the number
|
||||
# of nodes specified here
|
||||
min_step: 1
|
|
@ -0,0 +1,23 @@
|
|||
# Sample scaling policy that can be attached to a cluster
|
||||
# This policy scales out a cluster when a threshold alarm on ceilometer
|
||||
# reaches alarm state
|
||||
|
||||
type: ScalingPolicy
|
||||
version: 1.0
|
||||
|
||||
schedule:
|
||||
start_time: "2015-05-08T07:00:00Z"
|
||||
end_time: "2015-10-08T07:00:00Z"
|
||||
recurrence: "0 7 * * 6"
|
||||
|
||||
handlers:
|
||||
- type: webhook
|
||||
action: SENLIN::ACTION::RESIZE
|
||||
params:
|
||||
type: EXACT_CAPACITY
|
||||
number: 15
|
||||
min_size: 15
|
||||
max_size: 50
|
||||
credentials:
|
||||
user: john
|
||||
password: secrete
|
Loading…
Reference in New Issue