X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/6c30ce16d082c9bbade8a186c13cfe434fd2541e..309e7c9a6b5e6b83395253fef033af9df49fefbf:/htools/Ganeti/HTools/CLI.hs?ds=sidebyside diff --git a/htools/Ganeti/HTools/CLI.hs b/htools/Ganeti/HTools/CLI.hs index 213de9b..33cacd9 100644 --- a/htools/Ganeti/HTools/CLI.hs +++ b/htools/Ganeti/HTools/CLI.hs @@ -38,6 +38,7 @@ module Ganeti.HTools.CLI -- * The options , oDataFile , oDiskMoves + , oSelInst , oInstMoves , oDynuFile , oEvacMode @@ -66,6 +67,7 @@ module Ganeti.HTools.CLI , oPrintNodes , oQuiet , oRapiMaster + , oReplay , oSaveCluster , oShowHelp , oShowVer @@ -73,9 +75,9 @@ module Ganeti.HTools.CLI , oVerbose ) where +import Control.Monad import Data.Maybe (fromMaybe) import qualified Data.Version -import Monad import System.Console.GetOpt import System.IO import System.Info @@ -102,6 +104,7 @@ data Options = Options , optExTags :: Maybe [String] -- ^ Tags to use for exclusion , optExecJobs :: Bool -- ^ Execute the commands via Luxi , optGroup :: Maybe GroupID -- ^ The UUID of the group to process + , optSelInst :: [String] -- ^ Instances to be excluded , optINodes :: Int -- ^ Nodes required for an instance , optISpec :: RSpec -- ^ Requested instance specs , optLuxi :: Maybe FilePath -- ^ Collect data from Luxi @@ -124,6 +127,7 @@ data Options = Options , optShowNodes :: Maybe [String] -- ^ Whether to show node status , optShowVer :: Bool -- ^ Just show the program version , optTieredSpec :: Maybe RSpec -- ^ Requested specs for tiered mode + , optReplay :: Maybe String -- ^ Unittests: RNG state , optVerbose :: Int -- ^ Verbosity level } deriving Show @@ -139,6 +143,7 @@ defaultOptions = Options , optExTags = Nothing , optExecJobs = False , optGroup = Nothing + , optSelInst = [] , optINodes = 2 , optISpec = RSpec 1 4096 102400 , optLuxi = Nothing @@ -161,6 +166,7 @@ defaultOptions = Options , optShowNodes = Nothing , optShowVer = False , optTieredSpec = Nothing + , optReplay = Nothing , optVerbose = 1 } @@ -178,6 +184,11 @@ oDiskMoves = Option "" ["no-disk-moves"] "disallow disk moves from the list of allowed instance changes,\ \ thus allowing only the 'cheap' failover/migrate operations" +oSelInst :: OptType +oSelInst = Option "" ["select-instances"] + (ReqArg (\ f opts -> Ok opts { optSelInst = sepSplit ',' f }) "INSTS") + "only select given instances for any moves" + oInstMoves :: OptType oInstMoves = Option "" ["no-instance-moves"] (NoArg (\ opts -> Ok opts { optInstMoves = False})) @@ -373,6 +384,11 @@ oTieredSpec = Option "" ["tiered-alloc"] "TSPEC") "enable tiered specs allocation, given as 'disk,ram,cpu'" +oReplay :: OptType +oReplay = Option "" ["replay"] + (ReqArg (\ stat opts -> Ok opts { optReplay = Just stat } ) "STATE") + "Pre-seed the random number generator with STATE" + oVerbose :: OptType oVerbose = Option "v" ["verbose"] (NoArg (\ opts -> Ok opts { optVerbose = optVerbose opts + 1 }))