Bug 1221518

Summary: VM hangs after wake-up from suspend to ram
Product: [Fedora] Fedora Reporter: Aleksandar Kostadinov <akostadi>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: akostadi, amit.shah, berrange, cfergeau, crobinso, dwmw2, itamar, jniederm, pbonzini, rjones, scottt.tw, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1380893 (view as bug list) Environment:
Last Closed: 2015-10-14 14:54:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fedora 20 VM pstack
none
fedora 21 VM pstack
none
fedora20 qemu log
none
fedora 21 qemu log
none
CPU usage pattern of fedora21 when hung
none
fedora 21 xml dump
none
fedora 20 - vm-manager hang on reset
none
pstack fedora22 on fedora21 host none

Description Aleksandar Kostadinov 2015-05-14 09:00:17 UTC
Created attachment 1025320 [details]
fedora 20 VM pstack

Description of problem:
Sometimes my VMs hang with strange CPU usage pattern after wake up from suspend. I'm running fedora 20 and fedora 21 VMs.

Sometimes even virtual machine manager GUI becomes unresponsive tryingto work with such VM. Strangely though after some time the machine recovers  by itself (sometimes).
In this occasion both machines returned to normal after calling `pstack` on them.

Attaching logs from both.

Version-Release number of selected component (if applicable):
qemu-kvm-2.1.3-6.fc21.x86_64

How reproducible:
hard, usually machine should be suspended for several hours

Comment 1 Aleksandar Kostadinov 2015-05-14 09:01:44 UTC
Created attachment 1025321 [details]
fedora 21 VM pstack

Comment 2 Richard W.M. Jones 2015-05-14 09:02:13 UTC
What's running inside the VMs?  Does whatever is running in the VMs
use NTP or kvmclock?

Comment 3 Aleksandar Kostadinov 2015-05-14 09:04:57 UTC
Created attachment 1025322 [details]
fedora20 qemu log

Comment 4 Aleksandar Kostadinov 2015-05-14 09:05:28 UTC
Created attachment 1025323 [details]
fedora 21 qemu log

Comment 5 Aleksandar Kostadinov 2015-05-14 09:06:52 UTC
Created attachment 1025324 [details]
CPU usage pattern of fedora21 when hung

attaching screenshot of CPU usage as reported by virtual machine manager

Comment 6 Aleksandar Kostadinov 2015-05-14 09:42:07 UTC
@Richard, on the fedora20 machine I see /usr/sbin/chronyd running and on the fedora 21 machine I don't see neither ntp, nor chronyd running. On both machines I see:
> cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
> kvm-clock

Comment 7 Cole Robinson 2015-05-20 22:07:27 UTC
How often does the hang happen?
For the f21 VM, please provide:

- sudo virsh dumpxml $vmname
- /var/log/libvirt/qemu/$vmname.log

Comment 8 Aleksandar Kostadinov 2015-05-21 08:12:17 UTC
Created attachment 1028014 [details]
fedora 21 xml dump

Attaching the xml dump. QEMU log already attached.

Comment 9 Aleksandar Kostadinov 2015-05-26 06:46:24 UTC
Created attachment 1029780 [details]
fedora 20 - vm-manager hang on reset

I just got another hang. Trying to 'reset' the VM through virtual machine manager caused it to hang and I see  some errors in qemu log (attached). `virsh destroy` fixed the issue.

Comment 10 Cole Robinson 2015-05-26 16:04:00 UTC
(In reply to Aleksandar Kostadinov from comment #9)
> Created attachment 1029780 [details]
> fedora 20 - vm-manager hang on reset
> 
> I just got another hang. Trying to 'reset' the VM through virtual machine
> manager caused it to hang and I see  some errors in qemu log (attached).
> `virsh destroy` fixed the issue.

This is likely a separate issue, please file a new bug report

Comment 11 Cole Robinson 2015-05-26 16:08:48 UTC
Both your VMs have this:

  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>

Which means s3/s4 support should be disabled. This is the default in virt-manager and gnome-boxes.

How are you triggering suspend in the VM?
Can you do this for your VMs, reboot them, and see if the suspend issues go away: sudo virt-xml $vmname --edit --pm suspend_to_mem=on,suspend_to_disk=on --confirm

FWIW there's another bug that was similar to this: https://bugzilla.redhat.com/show_bug.cgi?id=1223541

Comment 12 Aleksandar Kostadinov 2015-05-27 12:07:21 UTC
I do not trigger suspend in the VMs. I just close the laptop lid and it is suspending the host OS.
I'll try out the option though to see if it resolves any of the issues.

wrt filing a new bug - what should it be all about? One has to reproduce the VM freeze to get vm-manager freeze.

Comment 13 Cole Robinson 2015-05-27 13:45:40 UTC
Sorry I got my bugs confused, thought this was about suspending inside VMs.

Comment 14 Aleksandar Kostadinov 2015-07-31 03:44:00 UTC
Created attachment 1057904 [details]
pstack fedora22 on fedora21 host

I've got another hang, attaching pstack.

Comment 15 Aleksandar Kostadinov 2015-07-31 04:00:07 UTC
One other strange thing. Now my vm is fedora22 and host is fedora22. I tried regular machine shutdown but it somehow neded up in `pmsuspend` mode. I had to `virsh dompmwakeup vmname` and then force off to recover.

Comment 16 Cole Robinson 2015-10-14 14:54:31 UTC

*** This bug has been marked as a duplicate of bug 1233568 ***

Comment 17 Cole Robinson 2017-03-16 15:43:19 UTC

*** This bug has been marked as a duplicate of bug 1380893 ***