[Pkg-ganeti-devel] [ganeti] 29/165: Export more cluster operations
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit 5e355bf234d9c2ff1f3693d25f2e2f839613a587
Author: Klaus Aehlig <aehlig at google.com>
Date: Mon Jan 26 22:31:50 2015 +0100
Export more cluster operations
...so that they can be used for alternative allocation strategies.
Also, generalize them appropriately.
Signed-off-by: Klaus Aehlig <aehlig at google.com>
Reviewed-by: Petr Pudlak <pudlak at google.com>
---
src/Ganeti/HTools/Cluster.hs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/Ganeti/HTools/Cluster.hs b/src/Ganeti/HTools/Cluster.hs
index 91f2c00..c90a5a4 100644
--- a/src/Ganeti/HTools/Cluster.hs
+++ b/src/Ganeti/HTools/Cluster.hs
@@ -41,6 +41,11 @@ module Ganeti.HTools.Cluster
AllocDetails(..)
, GenericAllocSolution(..)
, AllocSolution
+ , emptyAllocSolution
+ , concatAllocs
+ , sumAllocs
+ , updateIl
+ , extractNl
, EvacSolution(..)
, Table(..)
, CStats(..)
@@ -52,6 +57,7 @@ module Ganeti.HTools.Cluster
-- * Generic functions
, totalResources
, computeAllocationDelta
+ , hasRequiredNetworks
-- * First phase functions
, computeBadItems
-- * Second phase functions
@@ -63,6 +69,8 @@ module Ganeti.HTools.Cluster
-- * Display functions
, printNodes
, printInsts
+ , genericAnnotateSolution
+ , solutionDescription
-- * Balacing functions
, setInstanceLocationScore
, doNextBalance
@@ -1076,14 +1084,16 @@ tryGroupAlloc opts mggl mgnl ngil gn inst cnt = do
-- | Calculate the new instance list after allocation solution.
updateIl :: Instance.List -- ^ The original instance list
- -> Maybe Node.AllocElement -- ^ The result of the allocation attempt
+ -> Maybe (Node.GenericAllocElement a) -- ^ The result of
+ -- the allocation attempt
-> Instance.List -- ^ The updated instance list
updateIl il Nothing = il
updateIl il (Just (_, xi, _, _)) = Container.add (Container.size il) xi il
-- | Extract the the new node list from the allocation solution.
extractNl :: Node.List -- ^ The original node list
- -> Maybe Node.AllocElement -- ^ The result of the allocation attempt
+ -> Maybe (Node.GenericAllocElement a) -- ^ The result of the
+ -- allocation attempt
-> Node.List -- ^ The new node list
extractNl nl Nothing = nl
extractNl _ (Just (xnl, _, _, _)) = xnl
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list