On Thu, Oct 31, 2013 at 2:58 PM, Klaus Aehlig <[email protected]> wrote:

> Add a new option, to be used by hsqueeze, to specify
> the amount of free resources that has to be on each
> node, in order not to start onlining standby nodes.
> It is given as a multiple of the standard allocation,
> as specified by the instance policy.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/HTools/CLI.hs | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/Ganeti/HTools/CLI.hs b/src/Ganeti/HTools/CLI.hs
> index 18deb94..8b22bef 100644
> --- a/src/Ganeti/HTools/CLI.hs
> +++ b/src/Ganeti/HTools/CLI.hs
> @@ -70,6 +70,7 @@ module Ganeti.HTools.CLI
>    , oMinDisk
>    , oMinGain
>    , oMinGainLim
> +  , oMinResources
>    , oMinScore
>    , oNoHeaders
>    , oNoSimulation
> @@ -148,6 +149,7 @@ data Options = Options
>    , optMdsk        :: Double         -- ^ Max disk usage ratio for nodes
>    , optMinGain     :: Score          -- ^ Min gain we aim for in a step
>    , optMinGainLim  :: Score          -- ^ Limit below which we apply
> mingain
> +  , optMinResources :: Double        -- ^ minimal resources for hsqueeze
>

nit: for consistency, start the comment with a captial letter


>    , optMinScore    :: Score          -- ^ The minimum score we aim for
>    , optNoHeaders   :: Bool           -- ^ Do not show a header line
>    , optNoSimulation :: Bool          -- ^ Skip the rebalancing dry-run
> @@ -206,6 +208,7 @@ defaultOptions  = Options
>    , optMdsk        = defReservedDiskRatio
>    , optMinGain     = 1e-2
>    , optMinGainLim  = 1e-1
> +  , optMinResources = 2.0
>    , optMinScore    = 1e-9
>    , optNoHeaders   = False
>    , optNoSimulation = False
> @@ -498,6 +501,15 @@ oMinGainLim =
>     "minimum cluster score for which we start checking the min-gain",
>     OptComplFloat)
>
> +oMinResources :: OptType
> +oMinResources =
> +  (Option "" ["minimal-resources"]
> +   (reqWithConversion (tryRead "minimal resources")
> +    (\d opts -> Ok opts { optMinResources = d}) "FACTOR")
> +   "minimal resources to be present on each in multiples of\
> +   \ the standard allocation for not onlining standby nodes",
> +   OptComplFloat)
> +
>  oMinScore :: OptType
>  oMinScore =
>    (Option "e" ["min-score"]
> --
> 1.8.4.1
>
>
LGTM, thanks

-- 
-- 
Helga Velroyen | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to