Revision e08424a8 htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
123 | 123 |
&& Node.availMem node > size * Types.unitMem |
124 | 124 |
&& Node.availCpu node > size * Types.unitCpu |
125 | 125 |
|
126 |
canBalance :: Cluster.Table -> Bool -> Bool -> Bool |
|
127 |
canBalance tbl dm evac = isJust $ Cluster.tryBalance tbl dm evac 0 0
|
|
126 |
canBalance :: Cluster.Table -> Bool -> Bool -> Bool -> Bool
|
|
127 |
canBalance tbl dm im evac = isJust $ Cluster.tryBalance tbl dm im evac 0 0
|
|
128 | 128 |
|
129 | 129 |
-- | Assigns a new fresh instance to a cluster; this is not |
130 | 130 |
-- allocation, so no resource checks are done |
... | ... | |
746 | 746 |
(xnl, xi, _, cv):[] -> |
747 | 747 |
let il' = Container.add (Instance.idx xi) xi il |
748 | 748 |
tbl = Cluster.Table xnl il' cv [] |
749 |
in not (canBalance tbl True False) |
|
749 |
in not (canBalance tbl True True False)
|
|
750 | 750 |
_ -> False |
751 | 751 |
|
752 | 752 |
-- | Checks that on a 2-5 node cluster, we can allocate a random |
... | ... | |
815 | 815 |
let ynl = Container.add (Node.idx hnode) hnode xnl |
816 | 816 |
cv = Cluster.compCV ynl |
817 | 817 |
tbl = Cluster.Table ynl il' cv [] |
818 |
in canBalance tbl True False |
|
818 |
in canBalance tbl True True False
|
|
819 | 819 |
|
820 | 820 |
-- | Checks consistency |
821 | 821 |
prop_ClusterCheckConsistency node inst = |
Also available in: Unified diff