, oForce
, oGroup
, oIAllocSrc
+ , oIgnoreNonRedundant
, oInstMoves
, oJobDelay
, genOLuxiSocket
, optForce :: Bool -- ^ Force the execution
, optGroup :: Maybe GroupID -- ^ The UUID of the group to process
, optIAllocSrc :: Maybe FilePath -- ^ The iallocation spec
+ , optIgnoreNonRedundant :: Bool -- ^ Ignore non-redundant instances
, optSelInst :: [String] -- ^ Instances to be excluded
, optLuxi :: Maybe FilePath -- ^ Collect data from Luxi
, optJobDelay :: Double -- ^ Delay before executing first job
, optForce = False
, optGroup = Nothing
, optIAllocSrc = Nothing
+ , optIgnoreNonRedundant = False
, optSelInst = []
, optLuxi = Nothing
, optJobDelay = 10
"Specify an iallocator spec as the cluster data source",
OptComplFile)
+oIgnoreNonRedundant :: OptType
+oIgnoreNonRedundant =
+ (Option "" ["ignore-non-redundant"]
+ (NoArg (\ opts -> Ok opts { optIgnoreNonRedundant = True }))
+ "Pretend that there are no non-redundant instances in the cluster",
+ OptComplNone)
+
oJobDelay :: OptType
oJobDelay =
(Option "" ["job-delay"]
, oSaveCluster
, oGroup
, oSkipNonRedundant
+ , oIgnoreNonRedundant
, oForce
, oOneStepOnly
]
, ("Dcolor", colorDcolor)
]
colorings = map (\(v,a) -> (v,(colorVertMap.a) nodeGraph)) colorAlgorithms
- smallestColoring =
+ smallestColoring = IntMap.elems $
(snd . minimumBy (comparing (IntMap.size . snd))) colorings
allNdx = map Node.idx $ Container.elems nlf
- splitted = mapM (\ grp -> partitionNonRedundant grp allNdx (nlf,ilf)) $
- IntMap.elems smallestColoring
- rebootGroups <- case splitted of
- Ok splitgroups -> return $ concat splitgroups
- Bad _ -> exitErr "Not enough capacity to move non-redundant\
- \ instances"
+ splitted = mapM (\ grp -> partitionNonRedundant grp allNdx (nlf,ilf))
+ smallestColoring
+ rebootGroups <- if optIgnoreNonRedundant opts
+ then return smallestColoring
+ else case splitted of
+ Ok splitgroups -> return $ concat splitgroups
+ Bad _ -> exitErr "Not enough capacity to move\
+ \ non-redundant instances"
let idToNode = (`Container.find` nodes)
nodesRebootGroups =
map (map idToNode . filter (`IntMap.member` nodes)) rebootGroups