'[libvirt] file_backed_memory' and '[DEFAULT] reserved_host_memory_mb' are incompatible

Bug #1882821 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Stephen Finucane
Ussuri
Fix Released
Undecided
Unassigned

Bug Description

Per title, the '[libvirt] file_backed_memory' and '[DEFAULT] reserved_host_memory_mb' config options are incompatible. Not only does '[DEFAULT] reserved_host_memory_mb' not really make sense for file backed memory (if you want to reserve "memory", configure a lower '[libvirt] file_backed_memory' value) but configuring a value for '[libvirt] file_backed_memory' that is lower than the value for '[DEFAULT] reserved_host_memory_mb', which currently defaults to 512MB, will break nova's resource reporting to placement:

  nova.exception.ResourceProviderUpdateFailed: Failed to update resource provider via URL /resource_providers/f39bde61-6f73-4ccb-9488-6efb9689730f/inventories: {"errors": [{"status": 400, "title": "Bad Request", "detail": "The server could not comply with the request since it is either malformed or otherwise incorrect.\n\n Unable to update inventory for resource provider f39bde61-6f73-4ccb-9488-6efb9689730f: Invalid inventory for 'MEMORY_MB' on resource provider 'f39bde61-6f73-4ccb-9488-6efb9689730f'. The reserved value is greater than total. ", "code": "placement.undefined_code", "request_id": "req-977e43e7-1a7c-4309-96ec-49a75bdea58a"}]}

Ideally we should error out if both values are configured, however, doing so would be a breaking change. Instead, we can warn if these are incompatible and then error our in a future release.

Changed in nova:
importance: Undecided → Medium
assignee: nobody → Stephen Finucane (stephenfinucane)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/734658

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/734658
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3b99747b42e460567d52cc6d748396cb349d56b8
Submitter: Zuul
Branch: master

commit 3b99747b42e460567d52cc6d748396cb349d56b8
Author: Stephen Finucane <email address hidden>
Date: Tue Jun 9 18:38:10 2020 +0100

    libvirt: Don't allow "reserving" file-backed memory

    When file-backed memory is configured, it is the only "memory" reported
    by nova and used by instances, with RAM used in caching capacity. We
    should be warning users of this and insisting they explicitly configure
    the '[DEFAULT] reserved_host_memory_mb' config option to 0. However,
    doing so now would be breaking change. Instead, start logging a warning
    instead, failing only for the truly broken combination of reserving more
    file-backed memory than we have allocated.

    Change-Id: I9619338ad0f60253b628d96543f8ce3ac86242e3
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1882821

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/736219

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/ussuri)

Reviewed: https://review.opendev.org/736219
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9d3ebd58aa6a7514ab4db401980848570415706a
Submitter: Zuul
Branch: stable/ussuri

commit 9d3ebd58aa6a7514ab4db401980848570415706a
Author: Stephen Finucane <email address hidden>
Date: Tue Jun 9 18:38:10 2020 +0100

    libvirt: Don't allow "reserving" file-backed memory

    When file-backed memory is configured, it is the only "memory" reported
    by nova and used by instances, with RAM used in caching capacity. We
    should be warning users of this and insisting they explicitly configure
    the '[DEFAULT] reserved_host_memory_mb' config option to 0. However,
    doing so now would be breaking change. Instead, start logging a warning
    instead, failing only for the truly broken combination of reserving more
    file-backed memory than we have allocated.

    Change-Id: I9619338ad0f60253b628d96543f8ce3ac86242e3
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1882821
    (cherry picked from commit 3b99747b42e460567d52cc6d748396cb349d56b8)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/906161

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.