On Tue, Oct 8, 2013 at 1:38 PM, Klaus Aehlig <[email protected]> wrote:

> This design document describes a new htool, hsqueeze, to
> be used to move the externally-mirrored instances in such a
> way that as few nodes as possible host instances at all.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  Makefile.am             |  1 +
>  doc/design-draft.rst    |  1 +
>  doc/design-hsqueeze.rst | 70
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 72 insertions(+)
>  create mode 100644 doc/design-hsqueeze.rst
>
> diff --git a/Makefile.am b/Makefile.am
> index bd6872e..b0677e1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -538,6 +538,7 @@ docinput = \
>         doc/design-hroller.rst \
>         doc/design-storagetypes.rst \
>          doc/design-upgrade.rst \
> +       doc/design-hsqueeze.rst \
>         doc/devnotes.rst \
>         doc/glossary.rst \
>         doc/hooks.rst \
> diff --git a/doc/design-draft.rst b/doc/design-draft.rst
> index 4c9893a..8eee725 100644
> --- a/doc/design-draft.rst
> +++ b/doc/design-draft.rst
> @@ -23,6 +23,7 @@ Design document drafts
>     design-ceph-ganeti-support.rst
>     design-upgrade.rst
>     design-daemons.rst
> +   design-hsqueeze.rst
>
>  .. vim: set textwidth=72 :
>  .. Local Variables:
> diff --git a/doc/design-hsqueeze.rst b/doc/design-hsqueeze.rst
> new file mode 100644
> index 0000000..d403314
> --- /dev/null
> +++ b/doc/design-hsqueeze.rst
> @@ -0,0 +1,70 @@
> +=============
> +HSqueeze tool
> +=============
> +
> +.. contents:: :depth: 4
> +
> +This is a design document detailing the node-freeing scheduler, HSqueeze.
> +
> +
> +Current state and shortcomings
> +==============================
> +
> +Externally-mirrored instances can be moved between nodes at low
> +cost. Therefore, it is attractive to free up nodes and power them down
> +at times of low usage, even for small periods of time, like nights or
> +weekends.
> +
> +Currently, the best way find out a suitable set of nodes to shut down
> +is to use the property of our balancedness metric to move instances
> +away from drained nodes. So, one would manually drain more and more
> +nodes and see, if `hbal` could find a solution freeing up all those
> +drained nodes.
> +
> +
> +Proposed changes
> +================
> +
> +We propose the addition of a new htool, called `hsqueeze`, to
> +automatically free up as many nodes as possible. By default, only
> +externally-mirrored instances are moved, but an option is provided to
> +additionally take DRBD instances (which can be moved without
> +downtimes), or even all instances into consideration.
> +
> +Computation of the set to free up
> +---------------------------------
> +
> +To determine which nodes can be freed up, `hsqueeze` basically
> +follows the same algorithm as the manual process. It greedily goes
> +through all non-master nodes and tries if the algorithm used by `hbal`
> +would find a solution (with the appropriate move restriction) that
> +frees up the extended set of nodes to be drained.
>

In which order are nodes tried to be marked as drained? In a cluster where
all instances are externally mirrored, draining the "fullest" nodes would
lead to the same target state as draining the "emptiest" nodes, but would
require much more moves. It would probably make sense to either try to
drain the least used nodes first, or to let the user specify which nodes
should be drained preferably (as mentioned two sections below).
It would even be possible/desirable to (optionally) try to find the optimal
solution by trying all possible permutations of draining nodes. As this
probably would take a while on larger clusters, this should only be
performed on explicit user request.


> +
> +Instance moves and execution
> +----------------------------
> +
> +Once the final set of nodes is determined, the instance moves are
> +determined by the same algorithm as `hbal` does. If requested by the
> +`-X` option, the nodes freed up are drained, and the instance moves
> +are executed in the same way as `hbal` does. Finally, the nodes are
> +powered down via the :doc:`design-oob`.
> +
> +
> +Design choices
> +==============
> +
> +The proposed algorithm build on top of the already present balancing
> +algorithm, instead of greedily packing nodes as full as possible. The
> +reason is, that in the end, a balanced cluster is needed anyway;
> +therefore, basing on the balancing algorithm reduces the number of
> +instance moves. Additionally, in that way, the final configuration can
> +benefit from all improvements to the balancing algorithm, like taking
> +dynamic CPU data into account.
> +
> +We decided to have a separate program instead of adding an option to
> +`hbal` to keep the interfaces, especially of `hbal`, cleaner. It is
> +not unlikely that, over time, additional `hsqueeze`-specific options
> +might be added, specifying, e.g., which nodes to prefer for
> +shutdown. With the approach of the `htools` of having a single binary
> +showing different behaviors, having an additional program also does not
> +introduce significant additional cost.
> --
> 1.8.4
>
>


-- 
Thomas Thrainer | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to