Commit d2fd234c authored by Klaus Aehlig's avatar Klaus Aehlig

Provide --target-resources option

Add a new option, to be used by hsqueeze, to specify the
target free resources on each node. It is given as a multiple
of the standard allocation, as specified in the instance policy.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 47c477c8
......@@ -92,6 +92,7 @@ module Ganeti.HTools.CLI
, oShowComp
, oSkipNonRedundant
, oStdSpec
, oTargetResources
, oTieredSpec
, oVerbose
, oPriority
......@@ -166,6 +167,7 @@ data Options = Options
, optShowVer :: Bool -- ^ Just show the program version
, optSkipNonRedundant :: Bool -- ^ Skip nodes with non-redundant instance
, optStdSpec :: Maybe RSpec -- ^ Requested standard specs
, optTargetResources :: Double -- ^ Target resources for squeezing
, optTestCount :: Maybe Int -- ^ Optional test count override
, optTieredSpec :: Maybe RSpec -- ^ Requested specs for tiered mode
, optReplay :: Maybe String -- ^ Unittests: RNG state
......@@ -223,6 +225,7 @@ defaultOptions = Options
, optShowNodes = Nothing
, optShowVer = False
, optStdSpec = Nothing
, optTargetResources = 1.0
, optTestCount = Nothing
, optTieredSpec = Nothing
, optReplay = Nothing
......@@ -637,6 +640,15 @@ oStdSpec =
"enable standard specs allocation, given as 'disk,ram,cpu'",
OptComplString)
oTargetResources :: OptType
oTargetResources =
(Option "" ["target-resources"]
(reqWithConversion (tryRead "target resources")
(\d opts -> Ok opts { optTargetResources = d}) "FACTOR")
"target resources to be left on each node after squeezing in\
\ multiples of the standard allocation",
OptComplFloat)
oTieredSpec :: OptType
oTieredSpec =
(Option "" ["tiered-alloc"]
......
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