Skip to content
Snippets Groups Projects
Commit ee9724b9 authored by Iustin Pop's avatar Iustin Pop
Browse files

Start using the utilisation scores in balancing

This enables the per-node load/total available capacity scores to be
used in balancing. Note that the total available capacity is currently
fixed at zero and cannot be changed by the user.
parent aa8d2e71
No related branches found
No related tags found
No related merge requests found
......@@ -198,6 +198,10 @@ detailedCVNames = [ "free_mem_cv"
, "reserved_mem_cv"
, "offline_score"
, "vcpu_ratio_cv"
, "cpu_load_cv"
, "mem_load_cv"
, "disk_load_cv"
, "net_load_cv"
]
-- | Compute the mem and disk covariance.
......@@ -225,7 +229,15 @@ compDetailedCV nl =
fromIntegral (offline_inst + online_inst)::Double
cpu_l = map Node.pCpu nodes
cpu_cv = varianceCoeff cpu_l
in [mem_cv, dsk_cv, n1_score, res_cv, off_score, cpu_cv]
(c_load, m_load, d_load, n_load) = unzip4 $
map (\n ->
let DynUtil c1 m1 d1 n1 = Node.utilLoad n
DynUtil c2 m2 d2 n2 = Node.utilPool n
in (c1/c2, m1/m2, d1/d2, n1/n2)
) nodes
in [ mem_cv, dsk_cv, n1_score, res_cv, off_score, cpu_cv
, varianceCoeff c_load, varianceCoeff m_load
, varianceCoeff d_load, varianceCoeff n_load]
-- | Compute the /total/ variance.
compCV :: Node.List -> Double
......
......@@ -158,7 +158,7 @@ create name_init mem_t_init mem_n_init mem_f_init
, mCpu = noLimit
, loDsk = noLimitInt
, hiCpu = noLimitInt
, utilPool = T.zeroUtil
, utilPool = T.baseUtil
, utilLoad = T.zeroUtil
}
......
......@@ -31,6 +31,7 @@ module Ganeti.HTools.Types
, Weight
, DynUtil(..)
, zeroUtil
, baseUtil
, addUtil
, subUtil
, Placement
......@@ -75,6 +76,10 @@ zeroUtil :: DynUtil
zeroUtil = DynUtil { cpuWeight = 0, memWeight = 0
, dskWeight = 0, netWeight = 0 }
baseUtil :: DynUtil
baseUtil = DynUtil { cpuWeight = 1, memWeight = 1
, dskWeight = 1, netWeight = 1 }
addUtil :: DynUtil -> DynUtil -> DynUtil
addUtil (DynUtil a1 a2 a3 a4) (DynUtil b1 b2 b3 b4) =
DynUtil (a1+b1) (a2+b2) (a3+b3) (a4+b4)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment