diff --git a/htools/Ganeti/HTools/CLI.hs b/htools/Ganeti/HTools/CLI.hs index dd0d3923aaa8cacf12bb6b984699160597087ab1..01bf935e09393f3b0783b3d7b3638f8727969bf9 100644 --- a/htools/Ganeti/HTools/CLI.hs +++ b/htools/Ganeti/HTools/CLI.hs @@ -38,8 +38,7 @@ module Ganeti.HTools.CLI -- * The options , oDataFile , oDiskMoves - , oSelInst - , oInstMoves + , oDiskTemplate , oDynuFile , oEvacMode , oExInst @@ -50,6 +49,7 @@ module Ganeti.HTools.CLI , oIMem , oINodes , oIVcpus + , oInstMoves , oLuxiSocket , oMaxCpu , oMaxSolLength @@ -69,6 +69,7 @@ module Ganeti.HTools.CLI , oRapiMaster , oReplay , oSaveCluster + , oSelInst , oShowHelp , oShowVer , oTieredSpec @@ -104,6 +105,7 @@ data Options = Options { optDataFile :: Maybe FilePath -- ^ Path to the cluster data file , optDiskMoves :: Bool -- ^ Allow disk moves , optInstMoves :: Bool -- ^ Allow instance moves + , optDiskTemplate :: DiskTemplate -- ^ The requested disk template , optDynuFile :: Maybe FilePath -- ^ Optional file with dynamic use data , optEvacMode :: Bool -- ^ Enable evacuation mode , optExInst :: [String] -- ^ Instances to be excluded @@ -143,6 +145,7 @@ defaultOptions = Options { optDataFile = Nothing , optDiskMoves = True , optInstMoves = True + , optDiskTemplate = DTDrbd8 , optDynuFile = Nothing , optEvacMode = False , optExInst = [] @@ -192,6 +195,13 @@ oDiskMoves = Option "" ["no-disk-moves"] "disallow disk moves from the list of allowed instance changes,\ \ thus allowing only the 'cheap' failover/migrate operations" +oDiskTemplate :: OptType +oDiskTemplate = Option "" ["disk-template"] + (ReqArg (\ t opts -> do + dt <- dtFromString t + return $ opts { optDiskTemplate = dt }) "TEMPLATE") + "select the desired disk template" + oSelInst :: OptType oSelInst = Option "" ["select-instances"] (ReqArg (\ f opts -> Ok opts { optSelInst = sepSplit ',' f }) "INSTS")