README 2.85 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1
2
Ganeti Cluster tools (ganeti-htools)
====================================
Iustin Pop's avatar
Iustin Pop committed
3

Iustin Pop's avatar
Iustin Pop committed
4
5
These are some simple cluster tools for fixing common allocation
problems on Ganeti 2.0 clusters.
Iustin Pop's avatar
Iustin Pop committed
6

Iustin Pop's avatar
Iustin Pop committed
7
8
9
10
11
12
Note that these tools are most useful for bigger cluster sizes
(e.g. more than five or ten machines); at lower sizes, the
computations they do can also be done manually.

Available tools
---------------
Iustin Pop's avatar
Iustin Pop committed
13

Iustin Pop's avatar
Iustin Pop committed
14
Cluster rebalancer
Iustin Pop's avatar
Iustin Pop committed
15
~~~~~~~~~~~~~~~~~~
Iustin Pop's avatar
Iustin Pop committed
16

Iustin Pop's avatar
Iustin Pop committed
17
18
19
The rebalancer uses a simple algorithm to try to get the nodes of the
cluster as equal as possible in their resource usage. It tries to
repeatedly move each instance one step, so that the cluster score
Iustin Pop's avatar
Iustin Pop committed
20
21
22
23
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
24
Cluster N+1 solver
Iustin Pop's avatar
Iustin Pop committed
25
~~~~~~~~~~~~~~~~~~
Iustin Pop's avatar
Iustin Pop committed
26
27
28
29
30
31

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
32
33
34
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
35

Iustin Pop's avatar
Iustin Pop committed
36
IAllocator plugin
Iustin Pop's avatar
Iustin Pop committed
37
~~~~~~~~~~~~~~~~~
Iustin Pop's avatar
Iustin Pop committed
38

Iustin Pop's avatar
Iustin Pop committed
39
40
41
42
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
Iustin Pop's avatar
Iustin Pop committed
43
``/usr/local/lib/ganeti/iallocators``. See the man page hail(1).
Iustin Pop's avatar
Iustin Pop committed
44
45
46
47

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

Iustin Pop's avatar
Iustin Pop committed
48
49
50
51
52
53
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
54

Iustin Pop's avatar
Iustin Pop committed
55
56
57
58
For generating the 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
59

Iustin Pop's avatar
Iustin Pop committed
60
    gnt-node list -oname,mtotal,mnode,mfree,dtotal,dfree,offline \
Iustin Pop's avatar
Iustin Pop committed
61
      --separator '|' --no-headers > nodes
Iustin Pop's avatar
Iustin Pop committed
62
    gnt-instance list -oname,be/memory,sda_size,status,pnode,snodes \
Iustin Pop's avatar
Iustin Pop committed
63
64
      --separator '|' --no-head > instances

Iustin Pop's avatar
Iustin Pop committed
65
66
These two files should be saved under the names of *nodes* and
*instances*.
Iustin Pop's avatar
Iustin Pop committed
67
68
69
70
71
72
73

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
74

Iustin Pop's avatar
Iustin Pop committed
75
76
- json
- curl
Iustin Pop's avatar
Iustin Pop committed
77

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

Iustin Pop's avatar
Iustin Pop committed
81
82
Internal (implementation) documentation is available in the ``apidoc``
directory.
Iustin Pop's avatar
Iustin Pop committed
83
84
85
86

.. Local Variables:
.. mode: rst
.. End: