root / README @ 5ac3214f
History | View | Annotate | Download (3.5 kB)
1 |
Ganeti Cluster tools (ganeti-htools) |
---|---|
2 |
==================================== |
3 |
|
4 |
These are some simple cluster tools for fixing common allocation |
5 |
problems on Ganeti 2.0 clusters. |
6 |
|
7 |
Note that these tools are most useful for bigger cluster sizes |
8 |
(e.g. more than five or ten machines); at lower sizes, the |
9 |
computations they do can also be done manually. |
10 |
|
11 |
Most of the tools revolve around the concept of keeping the cluster |
12 |
N+1 compliant: this means that in case of failure of any node, the |
13 |
instances affected can be failed over (via ``gnt-node failover`` or |
14 |
``gnt-instance failover``) to their secondary node, and there is |
15 |
enough memory reserved for this operation without needing to shutdown |
16 |
other instances or rebalance the cluster. |
17 |
|
18 |
Available tools |
19 |
--------------- |
20 |
|
21 |
Cluster rebalancer |
22 |
~~~~~~~~~~~~~~~~~~ |
23 |
|
24 |
The rebalancer uses a simple algorithm to try to get the nodes of the |
25 |
cluster as equal as possible in their resource usage. It tries to |
26 |
repeatedly move each instance one step, so that the cluster score |
27 |
becomes better. We stop when no further move can improve the score. |
28 |
|
29 |
For algorithm details and usage, see the man page hbal(1). |
30 |
|
31 |
Cluster N+1 solver |
32 |
~~~~~~~~~~~~~~~~~~ |
33 |
|
34 |
This program runs a very simple brute force algorithm over the instance |
35 |
placement space in order to determine the shortest number of replace-disks |
36 |
needed to fix the cluster. Note this means we won't get a balanced cluster, |
37 |
just one that passes N+1 checks. |
38 |
|
39 |
For algorithm details and usage, see the man page hn1(1). |
40 |
|
41 |
.. note:: This program is deprecated, hbal should be used instead. |
42 |
|
43 |
IAllocator plugin |
44 |
~~~~~~~~~~~~~~~~~ |
45 |
|
46 |
The ``hail`` iallocator plugin can be used for allocations of mirrored |
47 |
and non-mirrored instances and for relocations of mirrored |
48 |
instances. It needs to be installed in Ganeti's iallocator search |
49 |
path—usually ``/usr/lib/ganeti/iallocators`` or |
50 |
``/usr/local/lib/ganeti/iallocators``. See the man page hail(1). |
51 |
|
52 |
Cluster capacity estimator |
53 |
~~~~~~~~~~~~~~~~~~~~~~~~~~ |
54 |
|
55 |
The ``hspace`` program will, given an input instance specification, |
56 |
estimate how many instances of those type can be place on the cluster |
57 |
before it will become full (as in any new allocation would fail N+1 |
58 |
checks). For more details, see the man page hspace(1). |
59 |
|
60 |
|
61 |
Integration with Ganeti |
62 |
----------------------- |
63 |
|
64 |
The ``hbal`` and ``hn1`` programs can either get their input from text |
65 |
files, or online from a cluster via RAPI. For online collection via |
66 |
RAPI, the "-m" argument to both hn1 and hbal should specify the |
67 |
cluster or master node name. ``hail`` uses the standard iallocator API |
68 |
and thus doesn't need any special setup (just needs to be installed in |
69 |
the right directory). |
70 |
|
71 |
For generating the text files, a separate tool (hscan) is provided to |
72 |
automate their gathering if RAPI is available, which is better since |
73 |
it can extract more precise information. In case RAPI is not usable |
74 |
for whatever reason, the following two commands should be run:: |
75 |
|
76 |
gnt-node list -oname,mtotal,mnode,mfree,dtotal,dfree,offline \ |
77 |
--separator '|' --no-headers > nodes |
78 |
gnt-instance list -oname,be/memory,sda_size,status,pnode,snodes \ |
79 |
--separator '|' --no-head > instances |
80 |
|
81 |
These two files should be saved under the names of *nodes* and |
82 |
*instances*. |
83 |
|
84 |
Installation |
85 |
------------ |
86 |
|
87 |
If installing from source, you need a working ghc compiler (6.8 at |
88 |
least) and some extra Haskell libraries which usually need to be |
89 |
installed manually: |
90 |
|
91 |
- json |
92 |
- curl |
93 |
|
94 |
Once these are available, just typing *make* in the top-level |
95 |
directory should be enough. |
96 |
|
97 |
Internal (implementation) documentation is available in the ``apidoc`` |
98 |
directory. |
99 |
|
100 |
.. Local Variables: |
101 |
.. mode: rst |
102 |
.. End: |