Temporary fix for hspace's NPU calculation
authorIustin Pop <iustin@google.com>
Tue, 24 Jan 2012 16:19:31 +0000 (17:19 +0100)
committerIustin Pop <iustin@google.com>
Thu, 26 Jan 2012 13:34:39 +0000 (14:34 +0100)
commit5f3b040af2cfa210787776049737229a74059c1f
treedcf665b724e47d212d5a934d372cc2ea8b11602c
parent487e19623fe36ca24f825f6095ce2ea7cb1ad20d
Temporary fix for hspace's NPU calculation

hspace computes the NPU (normalised CPU units) via the
(used|pool|avail) VCPU divided by the (currently cluster-wide) max
vcpu_ratio.

However, in the future we'll have variable vcpu_ratios, so we can't
the calculation as such. We temporarily change to computing the
average vcpu_ratio across the cluster, however long-term this needs to
be improved, as ∑ (Vi/Pi) ≠ ∑ Vi / ∑ Pi. In the meantime we implement
this patch to remove the use of a global mcpu variable.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
htools/Ganeti/HTools/Program/Hspace.hs