Statistics
| Branch: | Tag: | Revision:

root / README @ 934c62dc

History | View | Annotate | Download (4.1 kB)

1 9256e36a Iustin Pop
Ganeti Cluster tools (ganeti-htools)
2 9256e36a Iustin Pop
====================================
3 e4f08c46 Iustin Pop
4 9256e36a Iustin Pop
These are some simple cluster tools for fixing common allocation
5 9256e36a Iustin Pop
problems on Ganeti 2.0 clusters.
6 e4f08c46 Iustin Pop
7 9256e36a Iustin Pop
Note that these tools are most useful for bigger cluster sizes
8 d3b1075f Iustin Pop
(e.g. more than five or ten machines); at lower sizes, the computations
9 d3b1075f Iustin Pop
they do can also be done manually.
10 9256e36a Iustin Pop
11 d3b1075f Iustin Pop
Most of the tools revolve around the concept of keeping the cluster N+1
12 d3b1075f Iustin Pop
compliant: this means that in case of failure of any node, the instances
13 d3b1075f Iustin Pop
affected can be failed over (via ``gnt-node failover`` or ``gnt-instance
14 d3b1075f Iustin Pop
failover``) to their secondary node, and there is enough memory reserved
15 d3b1075f Iustin Pop
for this operation without needing to shutdown other instances or
16 d3b1075f Iustin Pop
rebalance the cluster.
17 5ac3214f Iustin Pop
18 61d67afe Iustin Pop
**Quick start** (see the installation section for more details):
19 61d67afe Iustin Pop
20 61d67afe Iustin Pop
- (have the ghc compiler and the prerequisite libraries installed)
21 61d67afe Iustin Pop
- make
22 61d67afe Iustin Pop
- ./hbal -m $cluster -C -p
23 61d67afe Iustin Pop
- look at the original and final cluster layout, and if acceptable,
24 61d67afe Iustin Pop
  execute the given commands
25 61d67afe Iustin Pop
26 61d67afe Iustin Pop
27 9256e36a Iustin Pop
Available tools
28 9256e36a Iustin Pop
---------------
29 e4f08c46 Iustin Pop
30 80276b9e Iustin Pop
Cluster rebalancer
31 9256e36a Iustin Pop
~~~~~~~~~~~~~~~~~~
32 80276b9e Iustin Pop
33 9256e36a Iustin Pop
The rebalancer uses a simple algorithm to try to get the nodes of the
34 9256e36a Iustin Pop
cluster as equal as possible in their resource usage. It tries to
35 9256e36a Iustin Pop
repeatedly move each instance one step, so that the cluster score
36 80276b9e Iustin Pop
becomes better. We stop when no further move can improve the score.
37 80276b9e Iustin Pop
38 80276b9e Iustin Pop
For algorithm details and usage, see the man page hbal(1).
39 80276b9e Iustin Pop
40 80276b9e Iustin Pop
IAllocator plugin
41 9256e36a Iustin Pop
~~~~~~~~~~~~~~~~~
42 e4f08c46 Iustin Pop
43 80276b9e Iustin Pop
The ``hail`` iallocator plugin can be used for allocations of mirrored
44 d3b1075f Iustin Pop
and non-mirrored instances and for relocations of mirrored instances. It
45 d3b1075f Iustin Pop
needs to be installed in Ganeti's iallocator search path—usually
46 d3b1075f Iustin Pop
``/usr/lib/ganeti/iallocators`` or
47 d3b1075f Iustin Pop
``/usr/local/lib/ganeti/iallocators``, and after that it can be used via
48 d3b1075f Iustin Pop
ganeti's ``--iallocator`` option (in various gnt-node/gnt-instance
49 61d67afe Iustin Pop
commands). See the man page hail(1) for more details.
50 e4f08c46 Iustin Pop
51 5ac3214f Iustin Pop
Cluster capacity estimator
52 5ac3214f Iustin Pop
~~~~~~~~~~~~~~~~~~~~~~~~~~
53 5ac3214f Iustin Pop
54 5ac3214f Iustin Pop
The ``hspace`` program will, given an input instance specification,
55 5ac3214f Iustin Pop
estimate how many instances of those type can be place on the cluster
56 5ac3214f Iustin Pop
before it will become full (as in any new allocation would fail N+1
57 5ac3214f Iustin Pop
checks). For more details, see the man page hspace(1).
58 5ac3214f Iustin Pop
59 5ac3214f Iustin Pop
60 e4f08c46 Iustin Pop
Integration with Ganeti
61 e4f08c46 Iustin Pop
-----------------------
62 e4f08c46 Iustin Pop
63 266aea94 Iustin Pop
The ``hbal`` and ``hspace`` programs can either get their input from
64 d3b1075f Iustin Pop
text files, locally from the master daemon (when run on the master node
65 d3b1075f Iustin Pop
of a cluster), or remote from a cluster via RAPI. The "-L" argument
66 d3b1075f Iustin Pop
enables local collection (with an optional path to the unix socket). For
67 d3b1075f Iustin Pop
online collection via RAPI, the "-m" argument should specify the cluster
68 d3b1075f Iustin Pop
or master node name. Only ``hbal`` and ``hspace`` use these arguments,
69 d3b1075f Iustin Pop
``hail`` uses the standard iallocator API and thus doesn't need any
70 d3b1075f Iustin Pop
special setup (just needs to be installed in the right directory).
71 6ef35e3c Iustin Pop
72 61d67afe Iustin Pop
For generating the text files, a separate tool (``hscan``) is provided
73 d3b1075f Iustin Pop
to automate their gathering if RAPI is available, which is better since
74 d3b1075f Iustin Pop
it can extract more precise information. In case RAPI is not usable for
75 2b7a98ae Iustin Pop
whatever reason, ``gnt-node list`` and ``gnt-instance list`` could be
76 2b7a98ae Iustin Pop
used, and their output concatenated in a single file, separated by one
77 2b7a98ae Iustin Pop
blank line. If you need to do this manually, you'll need to check the
78 2b7a98ae Iustin Pop
sources to see which fields are needed exactly.
79 e4f08c46 Iustin Pop
80 6ef35e3c Iustin Pop
81 61d67afe Iustin Pop
The ``hail`` program gets its data automatically from Ganeti when used
82 61d67afe Iustin Pop
as described in its section.
83 61d67afe Iustin Pop
84 6ef35e3c Iustin Pop
Installation
85 6ef35e3c Iustin Pop
------------
86 6ef35e3c Iustin Pop
87 6ef35e3c Iustin Pop
If installing from source, you need a working ghc compiler (6.8 at
88 6ef35e3c Iustin Pop
least) and some extra Haskell libraries which usually need to be
89 6ef35e3c Iustin Pop
installed manually:
90 e4f08c46 Iustin Pop
91 2fe61f87 Iustin Pop
- json (http://hackage.haskell.org/package/json)
92 2fe61f87 Iustin Pop
- curl (http://hackage.haskell.org/package/curl)
93 2fe61f87 Iustin Pop
- network (http://hackage.haskell.org/package/network)
94 d53264c0 Iustin Pop
95 d3b1075f Iustin Pop
Once these are installed, just typing *make* in the top-level directory
96 d3b1075f Iustin Pop
should be enough.
97 e4f08c46 Iustin Pop
98 d3b1075f Iustin Pop
Only the ``hail`` program needs to be installed in a specific place, the
99 d3b1075f Iustin Pop
other tools are not location-dependent.
100 61d67afe Iustin Pop
101 61d67afe Iustin Pop
For running the (admittedly small) unittest suite (via *make check*),
102 61d67afe Iustin Pop
the QuickCheck version 1 library is needed.
103 61d67afe Iustin Pop
104 6ef35e3c Iustin Pop
Internal (implementation) documentation is available in the ``apidoc``
105 6ef35e3c Iustin Pop
directory.
106 9256e36a Iustin Pop
107 d3b1075f Iustin Pop
.. vim: set textwidth=72 :
108 9256e36a Iustin Pop
.. Local Variables:
109 9256e36a Iustin Pop
.. mode: rst
110 d3b1075f Iustin Pop
.. fill-column: 72
111 9256e36a Iustin Pop
.. End: