root / README @ 9256e36a
History | View | Annotate | Download (2.9 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 | 9256e36a | Iustin Pop | (e.g. more than five or ten machines); at lower sizes, the |
9 | 9256e36a | Iustin Pop | computations they do can also be done manually. |
10 | 9256e36a | Iustin Pop | |
11 | 9256e36a | Iustin Pop | Available tools |
12 | 9256e36a | Iustin Pop | --------------- |
13 | e4f08c46 | Iustin Pop | |
14 | 80276b9e | Iustin Pop | Cluster rebalancer |
15 | 9256e36a | Iustin Pop | ~~~~~~~~~~~~~~~~~~ |
16 | 80276b9e | Iustin Pop | |
17 | 9256e36a | Iustin Pop | The rebalancer uses a simple algorithm to try to get the nodes of the |
18 | 9256e36a | Iustin Pop | cluster as equal as possible in their resource usage. It tries to |
19 | 9256e36a | Iustin Pop | repeatedly move each instance one step, so that the cluster score |
20 | 80276b9e | Iustin Pop | becomes better. We stop when no further move can improve the score. |
21 | 80276b9e | Iustin Pop | |
22 | 80276b9e | Iustin Pop | For algorithm details and usage, see the man page hbal(1). |
23 | 80276b9e | Iustin Pop | |
24 | e4f08c46 | Iustin Pop | Cluster N+1 solver |
25 | 9256e36a | Iustin Pop | ~~~~~~~~~~~~~~~~~~ |
26 | e4f08c46 | Iustin Pop | |
27 | e4f08c46 | Iustin Pop | This program runs a very simple brute force algorithm over the instance |
28 | e4f08c46 | Iustin Pop | placement space in order to determine the shortest number of replace-disks |
29 | e4f08c46 | Iustin Pop | needed to fix the cluster. Note this means we won't get a balanced cluster, |
30 | e4f08c46 | Iustin Pop | just one that passes N+1 checks. |
31 | e4f08c46 | Iustin Pop | |
32 | 9256e36a | Iustin Pop | For algorithm details and usage, see the man page hn1(1). |
33 | 9256e36a | Iustin Pop | |
34 | 9256e36a | Iustin Pop | .. note:: This program is deprecated, hbal should be used instead. |
35 | e4f08c46 | Iustin Pop | |
36 | 80276b9e | Iustin Pop | IAllocator plugin |
37 | 9256e36a | Iustin Pop | ~~~~~~~~~~~~~~~~~ |
38 | e4f08c46 | Iustin Pop | |
39 | 80276b9e | Iustin Pop | The ``hail`` iallocator plugin can be used for allocations of mirrored |
40 | 80276b9e | Iustin Pop | and non-mirrored instances and for relocations of mirrored |
41 | 80276b9e | Iustin Pop | instances. It needs to be installed in Ganeti's iallocator search |
42 | 80276b9e | Iustin Pop | path—usually ``/usr/lib/ganeti/iallocators`` or |
43 | 9256e36a | Iustin Pop | ``/usr/local/lib/ganeti/iallocators``. See the man page hail(1). |
44 | e4f08c46 | Iustin Pop | |
45 | e4f08c46 | Iustin Pop | Integration with Ganeti |
46 | e4f08c46 | Iustin Pop | ----------------------- |
47 | e4f08c46 | Iustin Pop | |
48 | 80276b9e | Iustin Pop | The ``hbal`` and ``hn1`` programs can either get their input from text |
49 | 80276b9e | Iustin Pop | files, or online from a cluster via RAPI. For online collection via |
50 | 80276b9e | Iustin Pop | RAPI, the "-m" argument to both hn1 and hbal should specify the |
51 | 80276b9e | Iustin Pop | cluster or master node name. ``hail`` uses the standard iallocator API |
52 | 80276b9e | Iustin Pop | and thus doesn't need any special setup (just needs to be installed in |
53 | 80276b9e | Iustin Pop | the right directory). |
54 | 6ef35e3c | Iustin Pop | |
55 | 9256e36a | Iustin Pop | For generating the text files, a separate tool (hscan) is provided to |
56 | 9256e36a | Iustin Pop | automate their gathering if RAPI is available, which is better since |
57 | 9256e36a | Iustin Pop | it can extract more precise information. In case RAPI is not usable |
58 | 9256e36a | Iustin Pop | for whatever reason, the following two commands should be run:: |
59 | e4f08c46 | Iustin Pop | |
60 | 00b15752 | Iustin Pop | gnt-node list -oname,mtotal,mnode,mfree,dtotal,dfree,offline \ |
61 | e4f08c46 | Iustin Pop | --separator '|' --no-headers > nodes |
62 | 9256e36a | Iustin Pop | gnt-instance list -oname,be/memory,sda_size,status,pnode,snodes \ |
63 | e4f08c46 | Iustin Pop | --separator '|' --no-head > instances |
64 | e4f08c46 | Iustin Pop | |
65 | 80276b9e | Iustin Pop | These two files should be saved under the names of *nodes* and |
66 | 80276b9e | Iustin Pop | *instances*. |
67 | 6ef35e3c | Iustin Pop | |
68 | 6ef35e3c | Iustin Pop | Installation |
69 | 6ef35e3c | Iustin Pop | ------------ |
70 | 6ef35e3c | Iustin Pop | |
71 | 6ef35e3c | Iustin Pop | If installing from source, you need a working ghc compiler (6.8 at |
72 | 6ef35e3c | Iustin Pop | least) and some extra Haskell libraries which usually need to be |
73 | 6ef35e3c | Iustin Pop | installed manually: |
74 | e4f08c46 | Iustin Pop | |
75 | 6ef35e3c | Iustin Pop | - json |
76 | 6ef35e3c | Iustin Pop | - curl |
77 | d53264c0 | Iustin Pop | |
78 | 80276b9e | Iustin Pop | Once these are available, just typing *make* in the top-level |
79 | 80276b9e | Iustin Pop | directory should be enough. |
80 | e4f08c46 | Iustin Pop | |
81 | 6ef35e3c | Iustin Pop | Internal (implementation) documentation is available in the ``apidoc`` |
82 | 6ef35e3c | Iustin Pop | directory. |
83 | 9256e36a | Iustin Pop | |
84 | 9256e36a | Iustin Pop | .. Local Variables: |
85 | 9256e36a | Iustin Pop | .. mode: rst |
86 | 9256e36a | Iustin Pop | .. End: |