Commit b6d9bec8 authored by Dato Simó's avatar Dato Simó

Program/Harep.hs: add skeleton for the new auto-repair tool

harep(1) detects certain kind of problems with instances and applies the
allowed set of solutions. See doc/design-autorepair.rst.
Signed-off-by: default avatarDato Simó <dato@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent de9d75c8
......@@ -436,7 +436,7 @@ HS_COMPILE_PROGS= \
# All Haskell non-test programs to be compiled but not automatically installed
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck hroller
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
HS_ALL_PROGS = \
......@@ -505,6 +505,7 @@ HS_LIB_SRCS = \
src/Ganeti/HTools/Node.hs \
src/Ganeti/HTools/PeerMap.hs \
src/Ganeti/HTools/Program/Hail.hs \
src/Ganeti/HTools/Program/Harep.hs \
src/Ganeti/HTools/Program/Hbal.hs \
src/Ganeti/HTools/Program/Hcheck.hs \
src/Ganeti/HTools/Program/Hinfo.hs \
......
{-| Auto-repair tool for Ganeti.
-}
{-
Copyright (C) 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-}
module Ganeti.HTools.Program.Harep
( main
, arguments
, options) where
import Control.Monad
import Ganeti.Common
import Ganeti.Utils
import Ganeti.HTools.CLI
-- | Options list and functions.
options :: IO [OptType]
options = do
luxi <- oLuxiSocket
return
[ luxi
]
arguments :: [ArgCompletion]
arguments = []
-- | Main function.
main :: Options -> [String] -> IO ()
main _unused_opts args = do
unless (null args) $
exitErr "this program doesn't take any arguments."
return ()
......@@ -38,6 +38,7 @@ import System.IO.Error (isDoesNotExistError)
import Ganeti.Common (formatCommands, PersonalityList)
import Ganeti.HTools.CLI (Options, parseOpts, genericOpts)
import qualified Ganeti.HTools.Program.Hail as Hail
import qualified Ganeti.HTools.Program.Harep as Harep
import qualified Ganeti.HTools.Program.Hbal as Hbal
import qualified Ganeti.HTools.Program.Hcheck as Hcheck
import qualified Ganeti.HTools.Program.Hscan as Hscan
......@@ -53,6 +54,9 @@ personalities =
"Ganeti IAllocator plugin that implements the instance\
\ placement and movement using the same algorithm as\
\ hbal(1)"))
, ("harep", (Harep.main, Harep.options, Harep.arguments,
"auto-repair tool that detects certain kind of problems\
\ with instances and applies the allowed set of solutions"))
, ("hbal", (Hbal.main, Hbal.options, Hbal.arguments,
"cluster balancer that looks at the current state of\
\ the cluster and computes a series of steps designed\
......
......@@ -135,6 +135,9 @@ case_formatCommands =
[ " hail - Ganeti IAllocator plugin that implements the instance\
\ placement and"
, " movement using the same algorithm as hbal(1)"
, " harep - auto-repair tool that detects certain kind of problems\
\ with instances"
, " and applies the allowed set of solutions"
, " hbal - cluster balancer that looks at the current state of\
\ the cluster and"
, " computes a series of steps designed to bring the\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment