README 1.97 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1
2
Ganeti Cluster tools (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 problems. Right
now N+1 and rebalancing are included.
Iustin Pop's avatar
Iustin Pop committed
6
7
8
9
10
11
12
13
14
15


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
16
For algorithm details and usage, see the man page hn1(1).
Iustin Pop's avatar
Iustin Pop committed
17
18
19
20
21
22
23
24

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.

Iustin Pop's avatar
Iustin Pop committed
25
For algorithm details and usage, see the man page hbal(1).
Iustin Pop's avatar
Iustin Pop committed
26
27
28
29

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

Iustin Pop's avatar
Iustin Pop committed
30
31
32
33
34
35
36
37
38
The 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.

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
39

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

Iustin Pop's avatar
Iustin Pop committed
45
46
47
48
49
50
51
52
These two files should be saved under the names of *nodes* and *instances*.

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
53

Iustin Pop's avatar
Iustin Pop committed
54
55
- json
- curl
Iustin Pop's avatar
Iustin Pop committed
56

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

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