import qualified Ganeti.HTools.Program.Hscan as Hscan
import qualified Ganeti.HTools.Program.Hspace as Hspace
import qualified Ganeti.HTools.Program.Hinfo as Hinfo
+import qualified Ganeti.HTools.Program.Hroller as Hroller
-- | Supported binaries.
personalities :: PersonalityList Options
personalities =
- [ ("hail", (Hail.main, Hail.options, Hail.arguments,
- "Ganeti IAllocator plugin that implements the instance\
- \ placement and movement using the same algorithm as\
- \ hbal(1)"))
- , ("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\
- \ to bring the cluster into a better state"))
- , ("hcheck", (Hcheck.main, Hcheck.options, Hcheck.arguments,
- "cluster checker; prints information about cluster's\
- \ health and checks whether a rebalance done using\
- \ hbal would help"))
- , ("hscan", (Hscan.main, Hscan.options, Hscan.arguments,
- "tool for scanning clusters via RAPI and saving their\
- \ data in the input format used by hbal(1) and hspace(1)"))
- , ("hspace", (Hspace.main, Hspace.options, Hspace.arguments,
- "computes how many additional instances can be fit on a\
- \ cluster, while maintaining N+1 status."))
- , ("hinfo", (Hinfo.main, Hinfo.options, Hinfo.arguments,
- "cluster information printer; it prints information\
- \ about the current cluster state and its residing\
- \ nodes/instances"))
+ [ ("hail", (Hail.main, Hail.options, Hail.arguments,
+ "Ganeti IAllocator plugin that implements the instance\
+ \ placement and movement using the same algorithm as\
+ \ hbal(1)"))
+ , ("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\
+ \ to bring the cluster into a better state"))
+ , ("hcheck", (Hcheck.main, Hcheck.options, Hcheck.arguments,
+ "cluster checker; prints information about cluster's\
+ \ health and checks whether a rebalance done using\
+ \ hbal would help"))
+ , ("hscan", (Hscan.main, Hscan.options, Hscan.arguments,
+ "tool for scanning clusters via RAPI and saving their\
+ \ data in the input format used by hbal(1) and hspace(1)"))
+ , ("hspace", (Hspace.main, Hspace.options, Hspace.arguments,
+ "computes how many additional instances can be fit on a\
+ \ cluster, while maintaining N+1 status."))
+ , ("hinfo", (Hinfo.main, Hinfo.options, Hinfo.arguments,
+ "cluster information printer; it prints information\
+ \ about the current cluster state and its residing\
+ \ nodes/instances"))
+ , ("hroller", (Hroller.main, Hroller.options, Hroller.arguments,
+ "cluster rolling maintenance helper; it helps scheduling\
+ \ node reboots in a manner that doesn't conflict with the\
+ \ instances' topology"))
]
-{-| Ganeti configuration query daemon
+{-| Cluster rolling maintenance helper.
-}
{-
-Copyright (C) 2009, 2011, 2012 Google Inc.
+Copyright (C) 2012 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
-}
-module Main (main) where
+module Ganeti.HTools.Program.Hroller
+ ( main
+ , options
+ , arguments
+ ) where
-import qualified Ganeti.Confd.Server
-import Ganeti.Daemon
-import Ganeti.Runtime
-import qualified Ganeti.Constants as C
+import Ganeti.Common
+import Ganeti.HTools.CLI
-- | Options list and functions.
-options :: [OptType]
-options =
- [ oNoDaemonize
- , oNoUserChecks
- , oDebug
- , oPort C.defaultConfdPort
- , oBindAddress
- , oSyslogUsage
- ]
+options :: IO [OptType]
+options = do
+ luxi <- oLuxiSocket
+ return
+ [ luxi
+ , oRapiMaster
+ , oDataFile
+ , oIAllocSrc
+ , oOfflineNode
+ , oVerbose
+ , oQuiet
+ , oNoHeaders
+ , oSaveCluster
+ ]
+
+-- | The list of arguments supported by the program.
+arguments :: [ArgCompletion]
+arguments = []
-- | Main function.
-main :: IO ()
-main = genericMain GanetiConfd options
- Ganeti.Confd.Server.checkMain
- Ganeti.Confd.Server.prepMain
- Ganeti.Confd.Server.main
+main :: Options -> [String] -> IO ()
+main _ _ = return ()