Update Host Maintenance strategy documentation

Add clarifications to the documentation to reflect
the actual strategy usage, including:
 - updating parameter descriptions
 - extending the 'How to Use' section

Closes-Bug: #2111810
Change-Id: Ifd2876056cd8819c50658fb9f213246dc1546d42
This commit is contained in:
Ronelle Landy
2025-05-27 10:17:46 -04:00
parent fe8d8c8839
commit bfbd136f4b
2 changed files with 43 additions and 21 deletions

View File

@@ -11,10 +11,6 @@ Synopsis
.. watcher-term:: watcher.decision_engine.strategy.strategies.host_maintenance.HostMaintenance .. watcher-term:: watcher.decision_engine.strategy.strategies.host_maintenance.HostMaintenance
Requirements
------------
None.
Metrics Metrics
******* *******
@@ -56,15 +52,15 @@ Configuration
Strategy parameters are: Strategy parameters are:
==================== ====== ==================================== ==================== ====== ================================ ==================
parameter type default Value description parameter type description required/optional
==================== ====== ==================================== ==================== ====== ================================ ==================
``maintenance_node`` String The name of the compute node which ``maintenance_node`` String The name of the compute node Required
need maintenance. Required. which needs maintenance.
``backup_node`` String The name of the compute node which ``backup_node`` String The name of the compute node Optional
will backup the maintenance node. which will backup the
Optional. maintenance node.
==================== ====== ==================================== ==================== ====== ================================ ==================
Efficacy Indicator Efficacy Indicator
------------------ ------------------
@@ -80,13 +76,34 @@ to: https://specs.openstack.org/openstack/watcher-specs/specs/queens/approved/cl
How to use it ? How to use it ?
--------------- ---------------
Run an audit using Host Maintenance strategy.
Executing the actions will move the servers from compute01 host
to a host determined by the Nova scheduler service.
.. code-block:: shell
$ openstack optimize audit create \
-g cluster_maintaining -s host_maintenance \
-p maintenance_node=compute01
Run an audit using Host Maintenance strategy with a backup node specified.
Executing the actions will move the servers from compute01 host
to compute02 host.
.. code-block:: shell .. code-block:: shell
$ openstack optimize audit create \ $ openstack optimize audit create \
-g cluster_maintaining -s host_maintenance \ -g cluster_maintaining -s host_maintenance \
-p maintenance_node=compute01 \ -p maintenance_node=compute01 \
-p backup_node=compute02 \ -p backup_node=compute02
--auto-trigger
Note that after executing this strategy, the *maintenance_node* will be
marked as disabled, with the reason set to ``watcher_maintaining``.
To enable the node again:
.. code-block:: shell
$ openstack compute service set --enable compute01
External Links External Links
-------------- --------------

View File

@@ -27,16 +27,18 @@ LOG = log.getLogger(__name__)
class HostMaintenance(base.HostMaintenanceBaseStrategy): class HostMaintenance(base.HostMaintenanceBaseStrategy):
"""[PoC]Host Maintenance """Host Maintenance
*Description* *Description*
It is a migration strategy for one compute node maintenance, It is a migration strategy for one compute node maintenance,
without having the user's application been interrupted. without having the user's application been interrupted.
If given one backup node, the strategy will firstly If given one backup node (where backup node is the
destination node for migration), the strategy will firstly
migrate all instances from the maintenance node to migrate all instances from the maintenance node to
the backup node. If the backup node is not provided, the backup node. If the backup node is not provided,
it will migrate all instances, relying on nova-scheduler. it will migrate all instances, relying on nova-scheduler.
The maintenance node will then be disabled.
*Requirements* *Requirements*
@@ -44,11 +46,14 @@ class HostMaintenance(base.HostMaintenanceBaseStrategy):
*Limitations* *Limitations*
- This is a proof of concept that is not meant to be used in production
- It migrates all instances from one host to other hosts. It's better to
execute such strategy when load is not heavy, and use this algorithm
with `ONESHOT` audit.
- It assumes that cold and live migrations are possible. - It assumes that cold and live migrations are possible.
.. note::
It migrates all instances from one host to other hosts.
It is recommended to use this strategy in a planned maintenance
window where the load is low to minimize impact on the workloads,
and use this algorithm with `ONESHOT` audit.
""" """
INSTANCE_MIGRATION = "migrate" INSTANCE_MIGRATION = "migrate"