Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-66374

Some VMs fail RAM validations because they cannot report physical memory

    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • In Progress
    • Bug Fix
    • Hide
      *Cause*: In cases where the agent cannot calculate the amount of 'physical' memory (on some virtual machines), it falls back to measuring the amount of available memory, which excludes some overhead used by the system.
      *Consequence*: When the physical memory is not measurable, more available memory is required to meet validations than would be on a machine where the physical memory can be measured.
      *Fix*: When only available memory is measured, we allow a margin for system overhead when validating the minimum physical memory.
      *Result*: Virtual machines with the correct amount of 'physical' memory should pass validations even if that physical memory size cannot be measured directly.
      Show
      *Cause*: In cases where the agent cannot calculate the amount of 'physical' memory (on some virtual machines), it falls back to measuring the amount of available memory, which excludes some overhead used by the system. *Consequence*: When the physical memory is not measurable, more available memory is required to meet validations than would be on a machine where the physical memory can be measured. *Fix*: When only available memory is measured, we allow a margin for system overhead when validating the minimum physical memory. *Result*: Virtual machines with the correct amount of 'physical' memory should pass validations even if that physical memory size cannot be measured directly.
    • None
    • None
    • None
    • None

      When we calculate the RAM size of the host, the agent tries the following methods:

      1. dmidecode -t 17
      2. Counting the number of blocks in /sys/devices/system/memory and multiplying by the block size from /sys/devices/system/memory/block_size_bytes (as hex)..
      3. From /proc/meminfo

      The first two of these return the physical size of the DIMMs.
      The third returns only the usable memory, which is the size of the physical memory less what is reserved for e.g. the BIOS.

      When validating the RAM requirements, we allow a 100MiB tolerance to allow for VMs that don't have an exact power-of-two amount of virtual "physical" memory.

      However, on VMs where the first two methods of getting the RAM size fail, we are not making an apples-to-apples comparison. The difference between the usable size and the physical size is typically much more than 100MiB at the scales we use.

      It appears this may be the case on Hetzner, where a "16G" VM reports approximately 15995MiB of RAM instead of 16384MiB. (Note that this is still more than 16x10^9 bytes, so this is nothing to do with GB vs. GiB, despite what every AI will try to tell you.)

              zabitter Zane Bitter
              zabitter Zane Bitter
              None
              None
              Manoj Hans Manoj Hans
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: