hyperv reenlightenment can break live-migration

Bug #2046549 reported by Johannes Beisiegel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Jie Song

Bug Description

With ZED nova enabled some new hyperv settings for instances with
os_type="windows" property (https://opendev.org/openstack/nova/commit/57ab45323cf5617ebd2decd757e708673d949a8f).

Enabling the reenlightenment setting can lead to unmigrateable VMs.
QEMU currently does not support full re-enlightenment notifications (see https://www.qemu.org/docs/master/system/i386/hyperv.html).
Windows VMs which have hyperv or WSL enabled make use of that feature,
but qemu can only migrate them if a tsc-frequency is set. The frequency
setting however is not applied and when set would restrict the target hv
to support the exact frequency.

Trying to migrate instances with reenlightenment enabled will fail

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/eventlet/hubs/hub.py", line 476, in fire_timers
    timer() File "/usr/local/lib/python3.10/dist-packages/eventlet/hubs/timer.py", line 59, in __call__
    cb(*args, **kw)
  File "/usr/local/lib/python3.10/dist-packages/eventlet/event.py", line 175, in _do_send
    waiter.switch(result)
  File "/usr/local/lib/python3.10/dist-packages/eventlet/greenthread.py", line 221, in main
    result = function(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/nova/utils.py", line 656, in context_wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nova/virt/libvirt/driver.py", line 10214, in _live_migration_operation
    with excutils.save_and_reraise_exception():
  File "/usr/local/lib/python3.10/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
    self.force_reraise()
  File "/usr/local/lib/python3.10/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
    raise self.value
  File "/usr/local/lib/python3.10/dist-packages/nova/virt/libvirt/driver.py", line 10203, in _live_migration_operation
    guest.migrate(self._live_migration_uri(dest),
  File "/usr/local/lib/python3.10/dist-packages/nova/virt/libvirt/guest.py", line 642, in migrate
    self._domain.migrateToURI3(
  File "/usr/local/lib/python3.10/dist-packages/eventlet/tpool.py", line 193, in doit
    result = proxy_call(self._autowrap, f, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/eventlet/tpool.py", line 151, in proxy_call rv = execute(f, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/eventlet/tpool.py", line 132, in execute
    six.reraise(c, e, tb)
  File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise
    raise value
  File "/usr/local/lib/python3.10/dist-packages/eventlet/tpool.py", line 86, in tworker
    rv = meth(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/libvirt.py", line 2157, in migrateToURI3
    raise libvirtError('virDomainMigrateToURI3() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor:
2023-12-14T09:05:01.441735Z qemu-system-x86_64: Guest enabled re-enlightenment notifications, 'tsc-frequency=' has to be specified
2023-12-14T09:05:01.441854Z qemu-system-x86_64: error while loading state for instance 0x0 of device 'cpu'
2023-12-14T09:05:01.448766Z qemu-system-x86_64: load of migration failed: Invalid argument

Adding the tsc clock or removing the hypver reenlightenment will make migration work again.

eg.:
   <clock>
      <timer name='tsc' frequency='2095078000'/>
    </clock>

A related bug for windows enlightenments targets evmcs: https://bugs.launchpad.net/nova/+bug/2009280

tags: added: libvirt
tags: added: windows
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/c/openstack/nova/+/904183

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

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

commit e618e78edc6293d248a5fa2eb63b3fa636250fca
Author: songjie <email address hidden>
Date: Mon Dec 25 16:59:36 2023 +0800

    libvirt: stop enabling hyperv feature reenlightenment

    The 'reenlightenment' hyperv enlightenment will cause
    instances live-migration to fail (KVM currently doesn’t
    fully support reenlightenment notifications, see
    www.qemu.org/docs/master/system/i386/hyperv.html),
    so don't enable it now.

    Change-Id: I6821819450bc96e4304125ea3b76a0e462e6e33f
    Closes-Bug: #2046549
    Related-Bug: #2009280

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

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/nova/+/909086

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

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/nova/+/909098

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

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/nova/+/909229

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

Reviewed: https://review.opendev.org/c/openstack/nova/+/909086
Committed: https://opendev.org/openstack/nova/commit/436e525a970bb991e147a0b4c3ce389a815252c2
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 436e525a970bb991e147a0b4c3ce389a815252c2
Author: songjie <email address hidden>
Date: Mon Dec 25 16:59:36 2023 +0800

    libvirt: stop enabling hyperv feature reenlightenment

    The 'reenlightenment' hyperv enlightenment will cause
    instances live-migration to fail (KVM currently doesn’t
    fully support reenlightenment notifications, see
    www.qemu.org/docs/master/system/i386/hyperv.html),
    so don't enable it now.

    Change-Id: I6821819450bc96e4304125ea3b76a0e462e6e33f
    Closes-Bug: #2046549
    Related-Bug: #2009280
    (cherry picked from commit e618e78edc6293d248a5fa2eb63b3fa636250fca)

Jie Song (songjie-cmss)
Changed in nova:
assignee: nobody → Jie Song (songjie-cmss)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/nova/+/909229
Committed: https://opendev.org/openstack/nova/commit/47271bb705de445ca5e17ba5e3d503cade2a0959
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 47271bb705de445ca5e17ba5e3d503cade2a0959
Author: songjie <email address hidden>
Date: Mon Dec 25 16:59:36 2023 +0800

    libvirt: stop enabling hyperv feature reenlightenment

    The 'reenlightenment' hyperv enlightenment will cause
    instances live-migration to fail (KVM currently doesn’t
    fully support reenlightenment notifications, see
    www.qemu.org/docs/master/system/i386/hyperv.html),
    so don't enable it now.

    Change-Id: I6821819450bc96e4304125ea3b76a0e462e6e33f
    Closes-Bug: #2046549
    Related-Bug: #2009280
    (cherry picked from commit e618e78edc6293d248a5fa2eb63b3fa636250fca)
    (cherry picked from commit 436e525a970bb991e147a0b4c3ce389a815252c2)

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

Reviewed: https://review.opendev.org/c/openstack/nova/+/909098
Committed: https://opendev.org/openstack/nova/commit/201bfa5bd21e3436b5882880530d5937b7dca61c
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 201bfa5bd21e3436b5882880530d5937b7dca61c
Author: songjie <email address hidden>
Date: Mon Dec 25 16:59:36 2023 +0800

    libvirt: stop enabling hyperv feature reenlightenment

    The 'reenlightenment' hyperv enlightenment will cause
    instances live-migration to fail (KVM currently doesn’t
    fully support reenlightenment notifications, see
    www.qemu.org/docs/master/system/i386/hyperv.html),
    so don't enable it now.

    Change-Id: I6821819450bc96e4304125ea3b76a0e462e6e33f
    Closes-Bug: #2046549
    Related-Bug: #2009280
    (cherry picked from commit e618e78edc6293d248a5fa2eb63b3fa636250fca)
    (cherry picked from commit 436e525a970bb991e147a0b4c3ce389a815252c2)
    (cherry picked from commit 47271bb705de445ca5e17ba5e3d503cade2a0959)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 29.0.0.0rc1

This issue was fixed in the openstack/nova 29.0.0.0rc1 release candidate.

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

This issue was fixed in the openstack/nova 26.3.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.