Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-16

libvirt: Replace compareCPU() with compareHypervisorCPU()

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhos-18.0.0
    • None
    • openstack-nova
    • None
    • libvirt: Replace compareCPU() with compareHypervisorCPU()
    • False
    • Hide

      None

      Show
      None
    • False
    • Committed
    • No Docs Impact
    • To Do
    • openstack-nova-27.1.1-18.0.20230930093334.a869ab1.el9ost
    • Committed
    • No impact
    • 0% To Do, 0% In Progress, 100% Done
    • Release Note Not Required
    • Automated
    • 2023Q1
    • Red Hat OpenStack Services on OpenShift (formerly Red Hat OpenStack Platform)

      This epic tracks using the improved hypervior aware CPU API in libvirt
      to make more accurate selections accounting forwhat features can and cannot be virutaldised. this will improve the compatibility fo VM migrations between hosts of diffenrt CPU models.

      Problem
      -------

      The current CPU configuration libvirt APIs that Nova uses, compareCPU()
      and baselineCPU(), are "not very useful" (quoting the cover letter[1] of
      the libvirt patch series that introduced better APIs), because they
      don't consider the capabilities of the "host hypervisor" (KVM, QEMU and
      details libvirt knows about the host).

      More concretely, with compareCPU() and baselineCPU(), there is no way to
      ask if a given CPU model plus CPU flags combination is supported by KVM
      and a specific QEMU binary on the host. E.g. "is the combination of
      IvyBridge CPU model plus CPU flags 'pcid' and 'ssbd' supported by the
      host hypervisor?"

      And Nova needs a way to do fine-grained validation of a certain CPU
      model plus CPU flags against a specific QEMU binary (and KVM) to allow
      well-informed guest CPU configuration decisions.

      Proposal
      --------

      To solve the above problem, upstream libvirt (since 4.0.0, which
      requires QEMU 2.9 or above for x86_64) has introduced[2] two new CPU
      configuration APIs[1]:

      baselineHypervisorCPU()
      compareHypervisorCPU()

      As their names indicate, these APIs are designed to take into account
      the capabilities of the host hypervisor.

      Rework Nova's CPU selection logic to incorporate these
      "hypervisor-literate" CPU configuration APIs. This will allow for more
      effective and reliable guest CPU configuration.

      [1] https://www.redhat.com/archives/libvir-list/2018-May/msg01204.html
      – New CPU related APIs

      [2] https://bugzilla.redhat.com/show_bug.cgi?id=1559832[RFC]
      – Fine-grained API to validate if a given CPU model and flags are
      supported by QEMU / KVM

              kchamart@redhat.com Kashyap Chamarthy
              smooney@redhat.com Sean Mooney
              rhos-dfg-compute
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: