From a229fec4a6bfa60644b5f881230b92c8df0b63c9 Mon Sep 17 00:00:00 2001
From: licanwei
Date: Fri, 3 Aug 2018 23:44:40 -0700
Subject: [PATCH] improve strategy doc
Change-Id: Id84e086f316ab50999b43c4b4c60a59ca454e79c
---
.../strategy/strategies/saving_energy.py | 34 +++++++++++++------
.../strategies/storage_capacity_balance.py | 9 +++++
2 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/watcher/decision_engine/strategy/strategies/saving_energy.py b/watcher/decision_engine/strategy/strategies/saving_energy.py
index 5ce7931a5..9d9210d44 100644
--- a/watcher/decision_engine/strategy/strategies/saving_energy.py
+++ b/watcher/decision_engine/strategy/strategies/saving_energy.py
@@ -31,6 +31,8 @@ LOG = log.getLogger(__name__)
class SavingEnergy(base.SavingEnergyBaseStrategy):
"""Saving Energy Strategy
+ *Description*
+
Saving Energy Strategy together with VM Workload Consolidation Strategy
can perform the Dynamic Power Management (DPM) functionality, which tries
to save power by dynamically consolidating workloads even further during
@@ -51,19 +53,29 @@ class SavingEnergy(base.SavingEnergyBaseStrategy):
the given number and there are spare unused nodes(in poweroff state),
randomly select some nodes(unused,poweroff) and power on them.
+ *Requirements*
+
In this policy, in order to calculate the min_free_hosts_num,
users must provide two parameters:
- * One parameter("min_free_hosts_num") is a constant int number.
- This number should be int type and larger than zero.
+ * One parameter("min_free_hosts_num") is a constant int number.
+ This number should be int type and larger than zero.
- * The other parameter("free_used_percent") is a percentage number, which
- describes the quotient of min_free_hosts_num/nodes_with_VMs_num,
- where nodes_with_VMs_num is the number of nodes with VMs running on it.
- This parameter is used to calculate a dynamic min_free_hosts_num.
- The nodes with VMs refer to those nodes with VMs running on it.
+ * The other parameter("free_used_percent") is a percentage number, which
+ describes the quotient of min_free_hosts_num/nodes_with_VMs_num,
+ where nodes_with_VMs_num is the number of nodes with VMs running on it.
+ This parameter is used to calculate a dynamic min_free_hosts_num.
+ The nodes with VMs refer to those nodes with VMs running on it.
Then choose the larger one as the final min_free_hosts_num.
+
+ *Limitations*
+
+ * at least 2 physical compute hosts
+
+ *Spec URL*
+
+ http://specs.openstack.org/openstack/watcher-specs/specs/pike/implemented/energy-saving-strategy.html
"""
def __init__(self, config, osc=None):
@@ -113,16 +125,16 @@ class SavingEnergy(base.SavingEnergyBaseStrategy):
"properties": {
"free_used_percent": {
"description": ("a rational number, which describes the"
- "quotient of"
+ " quotient of"
" min_free_hosts_num/nodes_with_VMs_num"
- "where nodes_with_VMs_num is the number"
- "of nodes with VMs"),
+ " where nodes_with_VMs_num is the number"
+ " of nodes with VMs"),
"type": "number",
"default": 10.0
},
"min_free_hosts_num": {
"description": ("minimum number of hosts without VMs"
- "but still powered on"),
+ " but still powered on"),
"type": "number",
"default": 1
},
diff --git a/watcher/decision_engine/strategy/strategies/storage_capacity_balance.py b/watcher/decision_engine/strategy/strategies/storage_capacity_balance.py
index a1596ca16..ec431bdb8 100644
--- a/watcher/decision_engine/strategy/strategies/storage_capacity_balance.py
+++ b/watcher/decision_engine/strategy/strategies/storage_capacity_balance.py
@@ -41,6 +41,15 @@ class StorageCapacityBalance(base.WorkloadStabilizationBaseStrategy):
* You must have at least 2 cinder volume pools to run
this strategy.
+
+ *Limitations*
+
+ * Volume migration depends on the storage device.
+ It may take a long time.
+
+ *Spec URL*
+
+ http://specs.openstack.org/openstack/watcher-specs/specs/queens/implemented/storage-capacity-balance.html
"""
def __init__(self, config, osc=None):