From b3ded34244f564e936e98a5b62f601c9c2441b04 Mon Sep 17 00:00:00 2001 From: Alexander Chadin Date: Tue, 20 Feb 2018 17:39:53 +0300 Subject: [PATCH] Complete schema of workload_stabilization strategy This patch set completes schema by adding restrictions to different types of schema properties. It also makes workload_stabilization strategy more user friendly by setting cpu_util as default metric. Change-Id: If34cf4b7ee2f70dc9a86309cb94a90b19e3d9bec --- .../strategies/workload_stabilization.py | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/watcher/decision_engine/strategy/strategies/workload_stabilization.py b/watcher/decision_engine/strategy/strategies/workload_stabilization.py index c7e36a50d..f895dc582 100644 --- a/watcher/decision_engine/strategy/strategies/workload_stabilization.py +++ b/watcher/decision_engine/strategy/strategies/workload_stabilization.py @@ -23,6 +23,8 @@ This is workload stabilization strategy based on standard deviation algorithm. The goal is to determine if there is an overload in a cluster and respond to it by migrating VMs to stabilize the cluster. +This strategy has been tested in a small (32 nodes) cluster. + It assumes that live migrations are possible in your cluster. """ @@ -104,19 +106,47 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy): "metrics": { "description": "Metrics used as rates of cluster loads.", "type": "array", - "default": ["cpu_util", "memory.resident"] + "items": { + "type": "string", + "enum": ["cpu_util", "memory.resident"] + }, + "default": ["cpu_util"] }, "thresholds": { "description": "Dict where key is a metric and value " "is a trigger value.", "type": "object", - "default": {"cpu_util": 0.2, "memory.resident": 0.2} + "properties": { + "cpu_util": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "memory.resident": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "default": {"cpu_util": 0.1, "memory.resident": 0.1} }, "weights": { "description": "These weights used to calculate " "common standard deviation. Name of weight" " contains meter name and _weight suffix.", "type": "object", + "properties": { + "cpu_util_weight": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "memory.resident_weight": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, "default": {"cpu_util_weight": 1.0, "memory.resident_weight": 1.0} }, @@ -141,6 +171,7 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy): "retry_count": { "description": "Count of random returned hosts", "type": "number", + "minimum": 1, "default": 1 }, "periods": { @@ -152,12 +183,23 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy): "uses only the last period of all received" " ones.", "type": "object", + "properties": { + "instance": { + "type": "integer", + "minimum": 0 + }, + "node": { + "type": "integer", + "minimum": 0 + }, + }, "default": {"instance": 720, "node": 600} }, "granularity": { "description": "The time between two measures in an " "aggregated timeseries of a metric.", "type": "number", + "minimum": 0, "default": 300 }, }