Normally, capacity checks check for each group if each node
can be evacuated. However, to support the "independent groups"
option in hspace  computations, two things have to be done for
groups initially not redundant.
- No instance are allocated on those groups, and
- they must be ignored in global N+1 checks during the computation.
The latter is achieved by this algorithmic parameter.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/HTools/AlgorithmParams.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Ganeti/HTools/AlgorithmParams.hs 
b/src/Ganeti/HTools/AlgorithmParams.hs
index c49eed1..b93f437 100644
--- a/src/Ganeti/HTools/AlgorithmParams.hs
+++ b/src/Ganeti/HTools/AlgorithmParams.hs
@@ -42,6 +42,7 @@ module Ganeti.HTools.AlgorithmParams
   ) where
 
 import qualified Ganeti.HTools.CLI as CLI
+import qualified Ganeti.HTools.Types as T
 
 data AlgorithmOptions = AlgorithmOptions
   { algDiskMoves :: Bool            -- ^ Whether disk moves are allowed
@@ -53,6 +54,7 @@ data AlgorithmOptions = AlgorithmOptions
   , algMinGainLimit :: Double       -- ^ Limit below which minimal gain is used
   , algCapacity :: Bool             -- ^ Whether to check capacity properties,
                                     -- like global N+1 redundancy
+  , algCapacityIgnoreGroups :: [T.Gdx] -- ^ Groups to ignore in capacity checks
   , algRestrictToNodes :: Maybe [String] -- ^ nodes to restrict allocation to
   , algAcceptExisting :: Bool       -- ^ accept existing violations in capacity
                                     -- checks
@@ -69,6 +71,7 @@ fromCLIOptions opts = AlgorithmOptions
   , algMinGain = CLI.optMinGain opts
   , algMinGainLimit = CLI.optMinGainLim opts
   , algCapacity = CLI.optCapacity opts
+  , algCapacityIgnoreGroups = []
   , algRestrictToNodes = CLI.optRestrictToNodes opts
   , algAcceptExisting = CLI.optAcceptExisting opts
   }
-- 
2.6.0.rc0.131.gf624c3d

Reply via email to