Bug 1015636 - managed save can fail with: unexpected migration status in setup
Summary: managed save can fail with: unexpected migration status in setup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-04 16:24 UTC by Cole Robinson
Modified: 2013-11-26 04:10 UTC (History)
13 users (show)

Fixed In Version: libvirt-1.1.3.1-2.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-26 04:10:59 UTC


Attachments (Terms of Use)

Description Cole Robinson 2013-10-04 16:24:23 UTC
Running through some test day test cases on F20, managedsave has failed on me twice. Both times I had rebooted the VM, it booted to the gdm login prompt, I tried 'save' from virt-manager, it seemed to take a bit longer than normal before the jobinfo progress bar kicked (probably 5 seconds), then I get an error like: unexpected migration status in setup.

The virt-manager trackback shows it as coming from managedsave and not anything else.

Subsequent save/restore worked fine. I only managed to trigger it twice. I had another VM installing at the same time, so might be load related.

Google shows a guy on libvirt-users seeing a similar error last month FWIW: http://www.spinics.net/linux/fedora/libvirt-users/msg05199.html

Comment 1 Alexander Todorov 2013-10-08 14:19:33 UTC
Same for me with virt-manager-0.10.0-4.git79196cdf.fc20.noarch:

[Tue, 08 Oct 2013 10:14:55 virt-manager 3913] DEBUG (console:1240) Viewer connected
[Tue, 08 Oct 2013 10:15:23 virt-manager 3913] DEBUG (engine:991) Pausing vm 'fedora20-6'
[Tue, 08 Oct 2013 10:15:23 virt-manager 3913] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x7fce0c963ed8>
[Tue, 08 Oct 2013 10:16:29 virt-manager 3913] DEBUG (engine:999) Unpausing vm 'fedora20-6'
[Tue, 08 Oct 2013 10:16:29 virt-manager 3913] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x9e10de8>
[Tue, 08 Oct 2013 10:16:32 virt-manager 3913] DEBUG (engine:991) Pausing vm 'fedora20-6'
[Tue, 08 Oct 2013 10:16:32 virt-manager 3913] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x7fce0c97a410>
[Tue, 08 Oct 2013 10:16:34 virt-manager 3913] DEBUG (engine:999) Unpausing vm 'fedora20-6'
[Tue, 08 Oct 2013 10:16:34 virt-manager 3913] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0xcf9eb90>
[Tue, 08 Oct 2013 10:16:42 virt-manager 3913] DEBUG (asyncjob:194) Creating async job for function cb=<function cb at 0x7fce0c968d70>
[Tue, 08 Oct 2013 10:16:46 virt-manager 3913] DEBUG (console:1213) Viewer disconnected
[Tue, 08 Oct 2013 10:16:53 virt-manager 3913] DEBUG (error:84) error dialog message:
summary=Error saving domain: internal error: unexpected migration status in setup
details=Error saving domain: internal error: unexpected migration status in setup

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/engine.py", line 918, in cb
    vm.save(path, meter=asyncjob.get_meter())
  File "/usr/share/virt-manager/virtManager/domain.py", line 1309, in save
    self._backend.managedSave(0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 911, in managedSave
    if ret == -1: raise libvirtError ('virDomainManagedSave() failed', dom=self)
libvirtError: internal error: unexpected migration status in setup

Comment 2 Cole Robinson 2013-10-08 14:42:45 UTC
Root issue is likely that qemu 1.6 added a new migration status string "setup", this means the migrate job is in the works but hasn't started sending any data yet. Libvirt doesn't handle this state.

commit 29ae8a4133082e16970c9d4be09f4b6a15034617
Author: Michael R. Hines <mrhines@us.ibm.com>
Date:   Mon Jul 22 10:01:57 2013 -0400

    rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transition


Libvirt also has an 'inactive' string but qemu never returns that, maybe that should be removed.

I think for the most part setup == active, with no data reporting. Can probably stick a sleep in qemu to lengthen the setup period to more easily reproduce this.

Comment 3 Eric Blake 2013-10-08 14:51:10 UTC
I'm asking on the qemu list whether we should add a qemu patch to avoid the need to require a newer libvirt (by adding a new qemu migration capability that must be enabled before the new state is advertised); but meanwhile I agree that libvirt needs to be taught to learn this new state.

Comment 4 Eric Blake 2013-10-08 17:57:51 UTC
Sounds like qemu won't be making any changes; thus, we need the libvirt fix backported to any distro where we run new enough qemu.  Libvirt needs to be taught to recognize this particular new state, and to be made more tolerant so that any future new states are treated as active.
https://lists.gnu.org/archive/html/qemu-devel/2013-10/msg00908.html

Comment 5 Reno 2013-11-07 13:47:28 UTC
Hi, Eric, is there any progress about this bug fix?  

This problem has stopped me from upgrading qemu to 1.6.1. The libvirt "save" operation always fails with error "unexpected migration status in setup".

Comment 6 Eric Blake 2013-11-15 13:07:06 UTC
Patch is now upstream:
commit d35ae4143d11f45856ae002fcd419da0eb9bba9f
Author: Michael Avdienko <whitearchey@gmail.com>
Date:   Fri Nov 15 20:47:43 2013 +0900

    Fix migration with QEMU 1.6
    
    QEMU 1.6.0 introduced new migration status: setup
    Libvirt does not expect such string in QMP and refuses to migrate with error
    "unexpected migration status in setup"
    
    This patch fixes it.
    
    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>

Comment 7 Fedora Update System 2013-11-18 14:03:27 UTC
libvirt-1.1.3.1-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libvirt-1.1.3.1-2.fc20

Comment 8 Fedora Update System 2013-11-18 20:19:08 UTC
Package libvirt-1.1.3.1-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libvirt-1.1.3.1-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21624/libvirt-1.1.3.1-2.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-11-26 04:10:59 UTC
libvirt-1.1.3.1-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.