QEMU hypervisor type returned when libvirt_type = kvm

Bug #1195361 reported by Richard Theis
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Tetsuro Nakamura
openstack-manuals
Fix Released
High
Robb Romans

Bug Description

As the following output indicates, the QEMU hypervisor type is used even when libvirt_type = kvm in nova.conf.

# grep libvirt_type /etc/nova/nova.conf
libvirt_type = kvm
# nova hypervisor-show 1 | grep hypervisor_type
| hypervisor_type | QEMU

It appears that the OpenStack libvirt driver uses the libvirt connection type to determine the hypervisor type instead of the libvirt_type configuration option. Should libvirt_type be used to determine KVM vs QEMU hypervisor type or is there another configuration for this? From a user perspective, getting the QEMU versus KVM hypervisor type correct is important when setting the hypervisor_type property on an image.

Tags: libvirt
tags: added: libvirt
Michael Still (mikal)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Rongze Zhu (zrzhit)
Changed in nova:
assignee: nobody → Rongze Zhu (zrzhit)
Revision history for this message
David Peraza (dperaza) wrote :

libvirt does not differentiate between qemu and kvm when calling connection.getType(), which is the value returned in hypervisor-show, I think it is just parsing qemu out of the connection string libvirt.open("qemu:///system")

Would it be simpler to just return libvirt_type as the hypervisor_type in hypervisor-show? I wonder if this has repercussions for images out there using qemu to mean kvm in hypervisor_type filter.

Lawrance (jing)
Changed in nova:
assignee: Rongze Zhu (zrzhit) → Lawrance (jing)
assignee: Lawrance (jing) → nobody
assignee: nobody → Lawrance (jing)
assignee: Lawrance (jing) → nobody
Revision history for this message
Lawrance (jing) wrote :

sorry for the mistake of assignee:)

Lawrance (jing)
Changed in nova:
assignee: nobody → Lawrance (jing)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/40803

Lawrance (jing)
Changed in nova:
assignee: Lawrance (jing) → nobody
Revision history for this message
Richard Theis (rtheis) wrote :

If no code change will be made for this issue then the OpenStack Compute Administrator Manual should be updated to remove 'kvm' as a valid value for the image hypervisor_type property. And maybe document that 'qemu' is used for both QEMU and KVM hypervisor setups.

Lawrance (jing)
Changed in nova:
status: In Progress → Confirmed
Revision history for this message
Lawrance (jing) wrote :

agree with Richard.

Revision history for this message
Łukasz Jernaś (deejay1) wrote :

Shouldn't this bug be reassigned to openstack-manuals then?

Richard Theis (rtheis)
affects: nova → openstack-manuals
Revision history for this message
Robert Collins (lifeless) wrote :

This seems very much like a bug, as though qemu and kvm share a common interface, their capabilities are very very different.

Revision history for this message
Stephen Gordon (sgordon) wrote :

Moving back to nova for reassessment based on Robert's comment.

affects: openstack-manuals → nova
Changed in nova:
status: Confirmed → Incomplete
Revision history for this message
Sean Dague (sdague) wrote :

Honestly, it's really a docs bug.

Changed in nova:
status: Incomplete → Won't Fix
Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

Has any of you have references to pages that list this wrongly?

Revision history for this message
Andreas Jaeger (jaegerandi) wrote :
Changed in openstack-manuals:
status: New → Confirmed
importance: Undecided → High
Robb Romans (rromans)
Changed in openstack-manuals:
assignee: nobody → Robb Romans (rromans)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/122218

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

Reviewed: https://review.openstack.org/122218
Committed: https://git.openstack.org/cgit/openstack/openstack-manuals/commit/?id=59a201bdf276d751f41066373db125bd46f3c400
Submitter: Jenkins
Branch: master

commit 59a201bdf276d751f41066373db125bd46f3c400
Author: Robb Romans <email address hidden>
Date: Wed Sep 17 13:31:07 2014 -0500

    Remove kvm as a hypervisor_type argument

    QEMU is used whether specifying either qemu or kvm as an argument to
    hypervisor_type. Therefore, remove kvm as a supported argument.

    Change-Id: I89f2b907fa868e50c2b65c2bf4a8e414242dd9fc
    Closes-bug: #1195361

Changed in openstack-manuals:
status: In Progress → Fix Released
Revision history for this message
Chris Friesen (cbf123) wrote :

Given the thread on the operators list, it seems like this may still be an issue. Perhaps it would make sense to export the libvirt_type rather than the hypervisor driver when running hypervisor-show? It'd have to be done via a microversion, of course.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-manuals 15.0.0

This issue was fixed in the openstack/openstack-manuals 15.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/531327

Changed in nova:
assignee: nobody → Tetsuro Nakamura (tetsuro0907)
status: Won't Fix → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/531328

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/531347

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Tetsuro Nakamura (<email address hidden>) on branch: master
Review: https://review.openstack.org/531327
Reason: changed my mind to use ComputeNode.supported_hv_specs object.
https://review.openstack.org/#/c/531347/

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

Reviewed: https://review.openstack.org/531347
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=eaa766ee2093c24fd61c61e52f46bdd9ff9e93d2
Submitter: Zuul
Branch: master

commit eaa766ee2093c24fd61c61e52f46bdd9ff9e93d2
Author: Tetsuro Nakamura <email address hidden>
Date: Fri Jan 5 16:59:29 2018 +0900

    [libvirt] Filter hypervisor_type by virt_type

    ComputeNode.supported_hv_specs field has hypervisor_type
    infomation about which type (e.g. KVM or both KVM and QEMU) of guests
    are supported by the hypervisor, but it doesn't supply information
    about which virt_type is set to that compute node.

    This means that we have no way to know which type of guests are going
    to be built in that compute node from the ComputeNode object. This can
    cause wrong behavior in scheduler filters using the supported_hv_specs
    object, such as ImagePropertiesFilter.

    In libvirt driver, this patch adds a filter to exclude supported
    hypervisor_types other than the virt_type which has been set by
    operator via nova.conf.

    Partial-Bug: #1195361
    Change-Id: I986fe09f97e4d5cad940bea85a87c58606314dba

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Tetsuro Nakamura (<email address hidden>) on branch: master
Review: https://review.openstack.org/531328

Matt Riedemann (mriedem)
Changed in nova:
status: In Progress → Confirmed
status: Confirmed → Opinion
importance: Low → Wishlist
Revision history for this message
Matt Riedemann (mriedem) wrote :

Note that https://review.openstack.org/531347 regressed existing images for the ImagePropertiesFilter as David mentioned in comment 1 and seen in this thread where an operator was upgrading from ocata to rocky and now their images with hypervisor_type=qemu no longer land on any hosts because the hosts are configured with [libvirt]/virt_type=kvm.

http://lists.openstack.org/pipermail/openstack-discuss/2019-July/thread.html#7842

So the note for hypervisor_type here is wrong since Rocky:

https://docs.openstack.org/nova/rocky/admin/configuration/schedulers.html#imagepropertiesfilter

https://docs.openstack.org/glance/latest/admin/useful-image-properties.html is also wrong since it says "The hypervisor type. Note that qemu is used for both QEMU and KVM hypervisor types."

Revision history for this message
James Finnegan (jfinnegan) wrote :

Not sure if this is covered by this bug report, but Horizon also reports the wrong Hypervisor type due to this issue. In Horizon it shows QEMU, but if I check the Hypervisor it is running KVM and the instances are deploying as KVM.

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.