Domain save/restore does not work (kvm)

Bug #771227 reported by Paul McEnery
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Unassigned
qemu-kvm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Description: Ubuntu 11.04
Release: 11.04

libvirt-bin:
  Installed: 0.8.8-1ubuntu6
  Candidate: 0.8.8-1ubuntu6
  Version table:
 *** 0.8.8-1ubuntu6 0
        500 http://gb.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

You create a domain via virt-manager. Once installed it should be possible to save the state of a VM to disk, and restore it.

The domain appears to save correctly, and restores, but the host performs a fresh boot.
The same behaviour is seen when using virsh:

$ virsh save <name> <name>.save
$ virsh restore <name>.save

Please see attached video.

Revision history for this message
Paul McEnery (pmcenery) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better.

Is this a regression? That is, did this work as expected with a maverick or lucid host?

Can you reproduce this with an ubuntu (say natty) guest?

Changed in libvirt (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Paul McEnery (pmcenery) wrote :

I've been trying this out every time a new version of Ubuntu is coming up for release, and it has never worked! However, this is the most promising result that I have seen to date. Maverick version of virt-manager seems to be able to correctly save the running state to a file, however it prompts you for a save location. It does not default to the location down /var/lib/libvirt. However, there appears to be no way to restore the VM through virt-manager on maverick. Despite this, I could successfully restore via virsh as follows:

$ virsh restore debian.save

In this case, the console springs to life inside virt-manager - with the VM in the running state that I saved. This is the behaviour I would expect to see.

In terms of reproducibility, I have a Fedora and Debian guest. Neither are restorable on natty. They both simply start booting from scratch on restore.

I am very encouraged by the how good things are looking on the virtualisation front on natty. As I was saying, this is the closest that I have come seeing this work seamlessly since libvirt and virt-manager were included.

I suspect there is an issue with this particular version of libvirt. If I get some time I'll try rebuilding the 0.8.8 package with the 0.9.0 source and put it in my PPA.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I get the same result, using (to be clear) a qcow2 disk file of a lucid guest.

Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Paul McEnery (pmcenery) wrote :

After some further investigation, this bug appears to be a qemu-kvm bug. I installed the lucid version of qemu-kvm, downgraded the domain definition as follows:

<domain type='kvm'>
  [...]
  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
                                                ^^^^^
  [...]
</domain>

And the domain now suspends and resumes reliably.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Actually, on another natty laptop virsh save followed by restore works, with stock qemu-kvm.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The laptop on which restore worked has kernel 2.6.38-9-generic #43~lp747090v201104131212

While the laptop on which it does not has 2.6.38-8-generic #42-Ubuntu.

Which begs the question whether this is actually a dup of bug 747090, somehow causing grub to be started up at restore.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Paul,

it seems kind of a reach, but since it seems to work for me - could you try the kernel packages from https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/747090/comments/23 and see if that fixes the problem for you?

Revision history for this message
David Caro (dcaro) wrote :

@Serge,

That kernel fixes the problem for me too, thanks a lot!

Revision history for this message
Paul McEnery (pmcenery) wrote :

@Serge,

Sorry for the delay. I am sure the kernel update will fix the issue. I have however been running 2.6.38-8 with a custom patch to fix an issue with LXC (https://bugzilla.kernel.org/show_bug.cgi?id=31232), so I have not had a chance to roll a new one. I'm sure all the fixes will be part of the Ubuntu kernel soon...

Thanks for your help!

Revision history for this message
gk (gkocur) wrote :

I use 2.6.38-10-server #46, and have exactly the same problem - restore reboots the VM.
Everything works as expected with 2.6.35.

So, in my case resolution of #747090 didn't help. Not a duplicate?

Revision history for this message
Luke (luke-h6i) wrote :

I use 2.6.38-11-server #50 and I have the same issue.

When I try to save and restore the VM will be rebooted.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

As per two previous comments, un-marked this as a duplicate.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for the updates, Luke and gk.

Definately cannot reproduce this with precise, and don't recall seeing this with oneiric. So either this is hardware-specific, or it is only in natty. Will have to set up a natty host to test with.

Luke or gk, if it's possible for you to run 'ubuntu-bug qemu-kvm' to start a new bug, and note that they are duplicates of bug 771227, that will upload some helpful information about your installation.

Changed in qemu-kvm (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I can no longer reproduce this in precise. Marking fix released. SRU to natty is unlikely to happen, but if we can pinpoint the patch fixing it, backporting to oneiric might be doable.

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Fix Released
Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
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.