Project

General

Profile

Bug #26656

Display memory in consistent way

Added by Moti Asayag over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Based on the feedback from the mailing list:

Can you explain why one VM showed 1024Mi where others showed 1Gi for the memory?
It looked like it came straight from the API since the console also showed 1Gi where Foreman normally uses GB.

We need to make sure to always use GB while displaying virtual machine memory.
---
There is inconsistency in the reported memory - we should normalize it to a single units:


2.3.3 :016 > c.servers.map { |s| s.memory }
=> ["1Gi", "1024Mi", "1024Mi", "1024M"]

So we got Gi, Mi and M - but that doesn't contradict:
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory

However, can fractions be specified ? Assuming user would like less than 1G vm ?
We faced similar issue with MIQ kubevirt provider here:
https://github.com/ManageIQ/manageiq-providers-kubevirt/blob/master/app/models/manageiq/providers/kubevirt/memory_calculator.rb#L31

Associated revisions

Revision 163415ae (diff)
Added by Moti Asayag over 3 years ago

Fixes #26656 - Fix memory issues (#100)

The PR fixes few memory issues:
  • The memory default value should be a string (same as passed in
    arguments)
  • Memory default value should be provided as string (this is the
    expected format in the VM arguments)
  • Tests should be updated no to provide memory or CPU in order to rely
    on the defaults
  • Memory should be shown in a normalized way in the UI
  • When creating VM, the memory should be converted to MB, while before
    this PR it was considered to be MiB which lead to a lower amount of
    memory than expected.

History

#1 Updated by Shira Maximov over 3 years ago

  • Bugzilla link set to 1702228

#2 Updated by Moti Asayag over 3 years ago

  • Assignee changed from Shira Maximov to Moti Asayag
  • Status changed from New to Assigned

#3 Updated by Moti Asayag over 3 years ago

  • Difficulty changed from easy to medium

#4 Updated by Moti Asayag over 3 years ago

  • Pull request https://github.com/theforeman/foreman_kubevirt/pull/100 added

#5 Updated by Moti Asayag over 3 years ago

  • Status changed from Assigned to Ready For Testing

#6 Updated by Moti Asayag over 3 years ago

We'll align the presented units reported by KubeVirt to the same method presented size in foreman (using number_to_human_size), so the units will be unified with other providers and foreman memory presentation (MB or GB).

#7 Updated by Moti Asayag about 3 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF