Revision d26d808a

b/.gitignore
102 102
/htools/hscan
103 103
/htools/hail
104 104
/htools/hspace
105
/htools/htools
105 106
/htools/test
106 107
/htools/*.prof*
107 108
/htools/*.stat
b/Makefile.am
308 308
	htools/hbal \
309 309
	htools/hscan \
310 310
	htools/hail \
311
	htools/hspace
311
	htools/hspace \
312
	htools/htools
312 313

  
313 314
HS_ALL_PROGS = $(HS_PROGS) htools/test
314 315
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
......
580 581
	man/hail.1 \
581 582
	man/hbal.1 \
582 583
	man/hscan.1 \
583
	man/hspace.1
584
	man/hspace.1 \
585
	man/htools.1
584 586

  
585 587
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
586 588
manhtml = $(patsubst %.rst,%.html,$(manrst))
b/htools/htools.hs
1
{-| Main htools binary.
2

  
3
-}
4

  
5
{-
6

  
7
Copyright (C) 2011 Google Inc.
8

  
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2 of the License, or
12
(at your option) any later version.
13

  
14
This program is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
General Public License for more details.
18

  
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
02110-1301, USA.
23

  
24
-}
25

  
26
module Main (main) where
27

  
28
import Data.Char (toLower)
29
import System
30
import System.IO
31

  
32
import Ganeti.HTools.Utils
33

  
34
-- | Supported binaries.
35
personalities :: [(String, IO ())]
36
personalities = []
37

  
38
-- | Display usage and exit.
39
usage :: String -> IO ()
40
usage name = do
41
  hPutStrLn stderr $ "Unrecognised personality '" ++ name ++ "'."
42
  hPutStrLn stderr "This program must be installed under one of the following\
43
                   \ names:"
44
  mapM_ (hPutStrLn stderr . ("  - " ++) . fst) personalities
45
  hPutStrLn stderr "Please either rename/symlink the program or set\n\
46
                   \the environment variable HTOOLS to the desired role."
47
  exitWith $ ExitFailure 1
48

  
49
main :: IO ()
50
main = do
51
  binary <- getEnv "HTOOLS" `catch` (\_ -> getProgName)
52
  let name = map toLower binary
53
      boolnames = map (\(x, y) -> (x == name, y)) personalities
54
  select (usage name) boolnames
b/man/footer.rst
23 23
daemon), **ganeti-masterd**(8) (master daemon), **ganeti-rapi**(8)
24 24
(remote API daemon).
25 25

  
26
Ganeti htools: **hbal**(1) (cluster balancer), **hspace**(1) (capacity
27
calculation), **hail**(1) (IAllocator plugin), **hscan**(1) (data
28
gatherer from remote clusters).
26
Ganeti htools: **htools**(1) (generic binary), **hbal**(1) (cluster
27
balancer), **hspace**(1) (capacity calculation), **hail**(1) (IAllocator
28
plugin), **hscan**(1) (data gatherer from remote clusters).
29 29

  
30 30
COPYRIGHT
31 31
---------
b/man/htools.rst
1
HTOOLS(1) Ganeti | Version @GANETI_VERSION@
2
===========================================
3

  
4
NAME
5
----
6

  
7
htools - Cluster allocation and placement tools for Ganeti
8

  
9
SYNOPSIS
10
--------
11

  
12
**hbal**
13
  cluster balancer
14

  
15
**hspace**
16
  cluster capacity computation
17

  
18
**hail**
19
  IAllocator plugin
20

  
21
**hscan**
22
  saves cluster state for later reuse
23

  
24

  
25
DESCRIPTION
26
-----------
27

  
28

  
29
``htools`` is a suite of tools designed to help with allocation/movement
30
of instances and balancing of Ganeti clusters. ``htools`` is also the
31
generic binary that must be symlinked or hardlinked under each tool's
32
name in order to perform the different functions. Alternatively, the
33
environment variable HTOOLS can be used to set the desired role.
34

  
35
Installed as ``hbal``, it computes and optionally executes a suite of
36
instance moves in order to balance the cluster.
37

  
38
Installed as ``hspace``, it computes how many additional instances can
39
be fit on a cluster, while maintaining N+1 status. It can run on models
40
of existing clusters or of simulated clusters.
41

  
42
Installed as ``hail``, it acts as an IAllocator plugin, i.e. it is used
43
by Ganeti to compute new instance allocations and instance moves.
44

  
45
Installed as ``hscan``, it scans the local or remote cluster state and
46
saves it to files which can later be reused by the other roles.
47

  
48
COMMON OPTIONS
49
--------------
50

  
51
Options behave the same in all program modes, but not all program modes
52
support all options. Some common options are:
53

  
54
-v, --verbose
55
  Increase the output verbosity. Each usage of this option will
56
  increase the verbosity (currently more than 2 doesn't make sense)
57
  from the default of one.
58

  
59
-q, --quiet
60
  Decrease the output verbosity. Each usage of this option will
61
  decrease the verbosity (less than zero doesn't make sense) from the
62
  default of one.
63

  
64
-V, --version
65
  Just show the program version and exit.
66

  
67
UNITS
68
~~~~~
69

  
70
Some options accept not simply numerical values, but numerical values
71
together with a unit. By default, such unit-accepting options use
72
mebibytes. Using the lower-case letters of *m*, *g* and *t* (or their
73
longer equivalents of *mib*, *gib*, *tib*, for which case doesn't
74
matter) explicit binary units can be selected. Units in the SI system
75
can be selected using the upper-case letters of *M*, *G* and *T* (or
76
their longer equivalents of *MB*, *GB*, *TB*, for which case doesn't
77
matter).
78

  
79
More details about the difference between the SI and binary systems can
80
be read in the *units(7)* man page.
81

  
82
ENVIRONMENT
83
-----------
84

  
85
The environment variable ``HTOOLS`` can be used instead of
86
renaming/symlinking the programs; simply set it to the desired role and
87
then the name of the program is no longer used.
88

  
89
.. vim: set textwidth=72 :
90
.. Local Variables:
91
.. mode: rst
92
.. fill-column: 72
93
.. End:

Also available in: Unified diff