Skip to content

Commit

Permalink
feat(vm): round the runtimeOverhead to Mi (#367)
Browse files Browse the repository at this point in the history
round the runtimeOverhead to Mi
---------
Signed-off-by: yaroslavborbat <yaroslav.752@gmail.com>
  • Loading branch information
yaroslavborbat authored Sep 17, 2024
1 parent 94e4960 commit 3f2d886
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package internal

import (
"context"
"math"
"sort"
"strconv"
"time"
Expand Down Expand Up @@ -138,6 +139,8 @@ func (h *StatisticHandler) syncResources(changed *virtv2.VirtualMachine,

memoryOverhead := memoryPodRequest.DeepCopy()
memoryOverhead.Sub(memoryKVVMIRequest)
mi := int64(1024 * 1024)
memoryOverhead = *resource.NewQuantity(int64(math.Ceil(float64(memoryOverhead.Value())/float64(mi)))*mi, resource.BinarySI)

resources = virtv2.ResourcesStatus{
CPU: virtv2.CPUStatus{
Expand Down

0 comments on commit 3f2d886

Please sign in to comment.