Statistics
| Branch: | Tag: | Revision:

root / README @ b33a2243

History | View | Annotate | Download (2 kB)

1 6ef35e3c Iustin Pop
Ganeti Cluster tools (htools)
2 6ef35e3c Iustin Pop
=============================
3 e4f08c46 Iustin Pop
4 6ef35e3c Iustin Pop
These are some simple cluster tools for fixing common problems. Right
5 00b15752 Iustin Pop
now N+1 and rebalancing are included. Starting with version 0.1.0,
6 00b15752 Iustin Pop
only Ganeti 2.0 is supported.
7 e4f08c46 Iustin Pop
8 e4f08c46 Iustin Pop
9 e4f08c46 Iustin Pop
Cluster N+1 solver
10 e4f08c46 Iustin Pop
------------------
11 e4f08c46 Iustin Pop
12 e4f08c46 Iustin Pop
This program runs a very simple brute force algorithm over the instance
13 e4f08c46 Iustin Pop
placement space in order to determine the shortest number of replace-disks
14 e4f08c46 Iustin Pop
needed to fix the cluster. Note this means we won't get a balanced cluster,
15 e4f08c46 Iustin Pop
just one that passes N+1 checks.
16 e4f08c46 Iustin Pop
17 6ef35e3c Iustin Pop
For algorithm details and usage, see the man page hn1(1).
18 e4f08c46 Iustin Pop
19 e4f08c46 Iustin Pop
Cluster rebalancer
20 e4f08c46 Iustin Pop
------------------
21 e4f08c46 Iustin Pop
22 e4f08c46 Iustin Pop
Compared to the N+1 solver, the rebalancer uses a very simple algorithm:
23 e4f08c46 Iustin Pop
repeatedly try to move each instance one step, so that the cluster score
24 e4f08c46 Iustin Pop
becomes better. We stop when no further move can improve the score.
25 e4f08c46 Iustin Pop
26 6ef35e3c Iustin Pop
For algorithm details and usage, see the man page hbal(1).
27 e4f08c46 Iustin Pop
28 e4f08c46 Iustin Pop
Integration with Ganeti
29 e4f08c46 Iustin Pop
-----------------------
30 e4f08c46 Iustin Pop
31 6ef35e3c Iustin Pop
The programs can either get their input from text files, or online
32 6ef35e3c Iustin Pop
from a cluster via RAPI. For online collection via RAPI, the "-m"
33 6ef35e3c Iustin Pop
argument to both hn1 and hbal should specify the cluster or master
34 6ef35e3c Iustin Pop
node name.
35 6ef35e3c Iustin Pop
36 6ef35e3c Iustin Pop
For text files, a separate tool (hscan) is provided to automate their
37 6ef35e3c Iustin Pop
gathering if RAPI is available, which is better since it can extract
38 6ef35e3c Iustin Pop
more precise information. In case RAPI is not usable for whatever
39 6ef35e3c Iustin Pop
reason, the following two commands should be run::
40 e4f08c46 Iustin Pop
41 00b15752 Iustin Pop
    gnt-node list -oname,mtotal,mnode,mfree,dtotal,dfree,offline \
42 e4f08c46 Iustin Pop
      --separator '|' --no-headers > nodes
43 d2ac5526 Iustin Pop
    gnt-instance list -oname,admin_ram,sda_size,status,pnode,snodes \
44 e4f08c46 Iustin Pop
      --separator '|' --no-head > instances
45 e4f08c46 Iustin Pop
46 6ef35e3c Iustin Pop
These two files should be saved under the names of *nodes* and *instances*.
47 6ef35e3c Iustin Pop
48 6ef35e3c Iustin Pop
Installation
49 6ef35e3c Iustin Pop
------------
50 6ef35e3c Iustin Pop
51 6ef35e3c Iustin Pop
If installing from source, you need a working ghc compiler (6.8 at
52 6ef35e3c Iustin Pop
least) and some extra Haskell libraries which usually need to be
53 6ef35e3c Iustin Pop
installed manually:
54 e4f08c46 Iustin Pop
55 6ef35e3c Iustin Pop
- json
56 6ef35e3c Iustin Pop
- curl
57 d53264c0 Iustin Pop
58 6ef35e3c Iustin Pop
One these are available, just typing *make* in the top-level directory
59 6ef35e3c Iustin Pop
should be enough.
60 e4f08c46 Iustin Pop
61 6ef35e3c Iustin Pop
Internal (implementation) documentation is available in the ``apidoc``
62 6ef35e3c Iustin Pop
directory.