Skip host to guest CPU compatibility check for emulated (QEMU "TCG" mode) guests during live migration

Bug #1588003 reported by Kashyap Chamarthy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Kashyap Chamarthy
Liberty
Fix Released
Medium
Matt Riedemann
Mitaka
Fix Released
High
Kashyap Chamarthy

Bug Description

The _compare_cpu() method of Nova's libvirt driver performs guest vCPU
model to destination host CPU model comparison (during live migration)
even in the case of emulated (QEMU "TCG" mode) guests, where the CPU
instructions are emulated completely in software, and no hardware
acceleration, such as KVM is involved.

From nova/virt/libvirt/driver.py:

   [...]
   5464 def _compare_cpu(self, guest_cpu, host_cpu_str, instance):
   5465 """Check the host is compatible with the requested CPU
   [...] [...]
   5481 if CONF.libvirt.virt_type not in ['qemu', 'kvm']:
   5482 return
   5483

Skip the comparison for 'qemu' part above.

Fix for master branch is here:

    https://review.openstack.org/#/c/323467/ --
    libvirt: Skip CPU compatibility check for emulated guests

This bug is for stable branch backports: Mitaka and Liberty.

[Thanks: Daniel P. Berrange for the pointer.]

Related context and references
------------------------------

(a) This upstream discussion thread where using the custom CPU model
    ("gate64") is causing live migration CI jobs to fail.

    http://lists.openstack.org/pipermail/openstack-dev/2016-May/095811.html
    -- "[gate] [nova] live migration, libvirt 1.3, and the gate"

(b) Gate DevStack change to avoid setting the custom CPU model in
    nova.conf

    https://review.openstack.org/#/c/320925/4 -- don't set libvirt
    cpu_model

Changed in nova:
assignee: nobody → Kashyap Chamarthy (kashyapc)
importance: Undecided → High
Matt Riedemann (mriedem)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/324098

Revision history for this message
Matt Riedemann (mriedem) wrote :

stable/liberty is in security fix and critical regression fix only mode, which this doesn't qualify for. So we won't fix this upstream for stable/liberty, and will exclude the multinode non-voting job from stable/liberty changes since it won't work after the d-g change lands that depends on the nova change.

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

Reviewed: https://review.openstack.org/324098
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=54448676db784bfc233d4e846eacd115d03d9f3f
Submitter: Jenkins
Branch: stable/mitaka

commit 54448676db784bfc233d4e846eacd115d03d9f3f
Author: Kashyap Chamarthy <email address hidden>
Date: Tue May 31 17:50:51 2016 +0200

    libvirt: Skip CPU compatibility check for emulated guests

    Comparing host to guest CPU model for emulated guests (<domain
    type='qemu'>) should not matter -- in this mode the CPU is fully
    emulated in software and no hardware acceleration, like KVM, is
    involved.

    So, skip the CPU compatibility check for the QEMU domain type,
    and retain it for KVM guests.

    Conflicts:
        nova/tests/unit/virt/libvirt/test_driver.py

        (Remove references to instance object in
        'test_compare_cpu_virt_type_qemu'.)

    Closes-Bug: #1588003

    Co-Authored-By: Daniel P. Berrange <email address hidden>
    Change-Id: I8b782678a6dfa7bcfc203381037e1df4475c3194
    (cherry picked from commit afa31e67c3b7f8999da179b78a7051d70ca126bf)

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/325566

Alan Pevec (apevec)
Changed in nova:
status: In Progress → Invalid
Matt Riedemann (mriedem)
Changed in nova:
status: Invalid → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/liberty)

Reviewed: https://review.openstack.org/325566
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=895e7da3273a1a9de921f1fc8ad409df79d58809
Submitter: Jenkins
Branch: stable/liberty

commit 895e7da3273a1a9de921f1fc8ad409df79d58809
Author: Kashyap Chamarthy <email address hidden>
Date: Tue May 31 17:50:51 2016 +0200

    libvirt: Skip CPU compatibility check for emulated guests

    Comparing host to guest CPU model for emulated guests (<domain
    type='qemu'>) should not matter -- in this mode the CPU is fully
    emulated in software and no hardware acceleration, like KVM, is
    involved.

    So, skip the CPU compatibility check for the QEMU domain type,
    and retain it for KVM guests.

    Closes-Bug: #1588003

    Co-Authored-By: Daniel P. Berrange <email address hidden>
    Change-Id: I8b782678a6dfa7bcfc203381037e1df4475c3194
    (cherry picked from commit afa31e67c3b7f8999da179b78a7051d70ca126bf)
    (cherry picked from commit 54448676db784bfc233d4e846eacd115d03d9f3f)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 12.0.4

This issue was fixed in the openstack/nova 12.0.4 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 13.1.0

This issue was fixed in the openstack/nova 13.1.0 release.

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.