← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2069192] Re: nova can no longer disable the mem ballon device

 

Reviewed:  https://review.opendev.org/c/openstack/nova/+/945621
Committed: https://opendev.org/openstack/nova/commit/2180c205b4ab8f4646fb10b0ea4f7f6498ee8a72
Submitter: "Zuul (22348)"
Branch:    master

commit 2180c205b4ab8f4646fb10b0ea4f7f6498ee8a72
Author: Rajesh Tailor <ratailor@xxxxxxxxxx>
Date:   Wed Mar 26 20:38:37 2025 +0530

    Fix disable memballoon device
    
    As of now, as per document [1] setting ``mem_stats_period_seconds``
    conf parameter value to zero or negative, disables the memory balloon
    device, which had effect in older versions of libvirt.
    
    In newer version of libvirt [2], setting ``mem_stats_period_seconds`` to
    zero or negative value does not disable the memory balloon device and
    libvirt adds the memballoon elements in libvirt xml automatically.
    To disable memballoon device, libvirt xml should have <memballoon
    model='none'/> element added.
    
    This change adds the ``<memballoon model='none'/>`` in libvirt xml,
    if conf parameter ``mem_stats_period_seconds`` is set to zero or
    negative value.
    
    [1] https://docs.openstack.org/nova/latest/configuration/config.html#libvirt.mem_stats_period_seconds
    [2] https://libvirt.org/formatdomain.html#memory-balloon-device
    
    Closes-Bug: #2069192
    Change-Id: I990c89cfa75f4d89fb45d8a75a11a848a11ef93a


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2069192

Title:
  nova can no longer disable the mem ballon device

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) 2024.1 series:
  New
Status in OpenStack Compute (nova) 2024.2 series:
  New
Status in OpenStack Compute (nova) 2025.1 series:
  New
Status in OpenStack Compute (nova) 2025.2 series:
  Fix Released

Bug description:
  https://docs.openstack.org/nova/latest/configuration/config.html#libvirt.mem_stats_period_seconds

  setting the mem_stats_period_seconds value to 0 is documented as
  disabling the memory ballon

  in practice it disable the generation of the generate of the

   <memballoon model='virtio'/> element.

  in older version of libvirt that had the effect of disabling the mem
  ballon

  in libvirt 0.8.4 libvrt gaind the ability to disable the mem ballon
  explicitly by setting

  
  <memballoon model='none'/>

  and at some later point libvirt started adding a mem ballon deivece by
  default if one is not present in the XML

  while the exact version of libvirt that change was made in is not
  known the net effect is

  [libvirt]
  mem_stats_period_seconds=0 no longer disbales the memory balloon as documented.


  
  mem_stats_period_seconds

      Type:

          integer
      Default:

          10

      A number of seconds to memory usage statistics period. Zero or
  negative value mean to disable memory usage statistics.


  disabling the memory balloon and statistics is important for
  minimising the overhead of tracking that memory usage in realtime vms

  since nova does not currently set

  autodeflate the mem balloon in nova had no other use except metric reporting so when we set 
  mem_stats_period_seconds=0  we should explicitly disable the device in the XML to restore the old behavior.

  a future enhancement could be to set autodeflate=on when the device is
  present.

  this bug also interact with sev.

  sev requires all virtio devices to have the iommu=on driver option set 
  if you disabel mem stats today and libvirt adds a mem-ballon automatically it will not have this element set and that can cause issues with some feature like sev.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2069192/+subscriptions



References