Skip to content
Snippets Groups Projects
README 2.57 KiB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
Ganeti Cluster tools (htools)
=============================
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
These are some simple cluster tools for fixing common problems. Right
now N+1 and rebalancing are included. Starting with version 0.1.0,
only Ganeti 2.0 is supported.
Iustin Pop's avatar
Iustin Pop committed


Iustin Pop's avatar
Iustin Pop committed
Cluster rebalancer
------------------

Compared to the N+1 solver, the rebalancer uses a very simple algorithm:
repeatedly try to move each instance one step, so that the cluster score
becomes better. We stop when no further move can improve the score.

For algorithm details and usage, see the man page hbal(1).

Iustin Pop's avatar
Iustin Pop committed
Cluster N+1 solver
------------------

This program runs a very simple brute force algorithm over the instance
placement space in order to determine the shortest number of replace-disks
needed to fix the cluster. Note this means we won't get a balanced cluster,
just one that passes N+1 checks.

Iustin Pop's avatar
Iustin Pop committed
For algorithm details and usage, see the man page hn1(1). **Note**:
this program is deprecated, hbal should be used instead.
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
IAllocator plugin
-----------------
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
The ``hail`` iallocator plugin can be used for allocations of mirrored
and non-mirrored instances and for relocations of mirrored
instances. It needs to be installed in Ganeti's iallocator search
path—usually ``/usr/lib/ganeti/iallocators`` or
``/usr/local/lib/ganeti/iallocators``.
Iustin Pop's avatar
Iustin Pop committed

Integration with Ganeti
-----------------------

Iustin Pop's avatar
Iustin Pop committed
The ``hbal`` and ``hn1`` programs can either get their input from text
files, or online from a cluster via RAPI. For online collection via
RAPI, the "-m" argument to both hn1 and hbal should specify the
cluster or master node name. ``hail`` uses the standard iallocator API
and thus doesn't need any special setup (just needs to be installed in
the right directory).
Iustin Pop's avatar
Iustin Pop committed

For text files, a separate tool (hscan) is provided to automate their
gathering if RAPI is available, which is better since it can extract
more precise information. In case RAPI is not usable for whatever
reason, the following two commands should be run::
Iustin Pop's avatar
Iustin Pop committed

    gnt-node list -oname,mtotal,mnode,mfree,dtotal,dfree,offline \
Iustin Pop's avatar
Iustin Pop committed
      --separator '|' --no-headers > nodes
Iustin Pop's avatar
Iustin Pop committed
    gnt-instance list -oname,admin_ram,sda_size,status,pnode,snodes \
Iustin Pop's avatar
Iustin Pop committed
      --separator '|' --no-head > instances

Iustin Pop's avatar
Iustin Pop committed
These two files should be saved under the names of *nodes* and
*instances*.
Iustin Pop's avatar
Iustin Pop committed

Installation
------------

If installing from source, you need a working ghc compiler (6.8 at
least) and some extra Haskell libraries which usually need to be
installed manually:
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
- json
- curl
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
Once these are available, just typing *make* in the top-level
directory should be enough.
Iustin Pop's avatar
Iustin Pop committed

Iustin Pop's avatar
Iustin Pop committed
Internal (implementation) documentation is available in the ``apidoc``
directory.