Bug 995388 - Windows 2012 guest does not show "Hibernate" option in GUI power menu
Windows 2012 guest does not show "Hibernate" option in GUI power menu
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: 7.0
Assigned To: John Snow
Virtualization Bugs
:
Depends On:
Blocks: Virt-S3/S4-7.0
  Show dependency treegraph
 
Reported: 2013-08-09 04:48 EDT by Chao Yang
Modified: 2014-11-19 10:11 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-11-19 10:11:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
win2012 system log (22.96 KB, text/x-log)
2013-08-09 04:48 EDT, Chao Yang
no flags Details

  None (edit)
Description Chao Yang 2013-08-09 04:48:21 EDT
Created attachment 784766 [details]
win2012 system log

Description of problem:
Cannot suspend/resume from S4 inside win2012 guest.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.382.el6.x86_64
seabios-0.6.1.2-28.el6.x86_64
2.6.32-407.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. enable hibernate:
 powercfg /h on
 powercfg /a
The following sleep states are available on this system:
    Hibernate
    Fast Startup
2. go to Control Panel -> Hardware -> Power Options -> Change what the power buttons do -> When I press the power button: Hibernate 

3. Change settings that are currently unavailable -> Shutdown settings -> check 'Hibernate' -> Save changes

Actual results:
When click 'Power' button, this is no 'Hibernate'.

Expected results:


Additional info:
Will attach related system event log.
Comment 2 Ademar Reis 2013-08-12 18:43:17 EDT
S3/S4 are disabled by default. Did you enable them in qemu?
Comment 3 Chao Yang 2013-08-12 22:10:53 EDT
(In reply to Ademar de Souza Reis Jr. from comment #2)
> S3/S4 are disabled by default. Did you enable them in qemu?

Yes, I have added "-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0" in my cli.

# /usr/libexec/qemu-kvm -nodefaults -name test -M rhel6.5.0 -cpu host -enable-kvm -m 2048 -smp 2,sockets=4,cores=2,threads=1,maxcpus=8 -rtc base=localtime,clock=host,driftfix=slew -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-scsi-pci,id=scsi -drive file=/home/win2012.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device scsi-disk,bus=scsi.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,lun=0 -netdev tap,id=hostnet1 -device e1000,netdev=hostnet1,id=net1,mac=00:1a:4a:42:48:12,bus=pci.0 -spice port=5900,disable-ticketing,seamless-migration=on -k en-us -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432  -monitor stdio -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -boot menu=on
Comment 5 mazhang 2013-08-16 01:40:42 EDT
win2012r2 hit this problem.
Comment 9 John Snow 2014-11-18 15:03:47 EST
I attempted to reproduce this upstream (qemu 2.2 rc2) and here is what I saw:

1) Installed Windows 2012 r2 (with updates) x86_64
2) Booted and typed POWERCFG /HIBERNATE ON. Command completes silently.
3) Typed "shutdown -h" to initiate a hibernation.
4) Qemu completes this action and closes.
5) Started qemu again.
6) Verified that my command line and several other windows that were open were still available, confirming the hibernation and resume completed successfully.

However, I will say that the "power" menu doesn't show the hibernate option. Is that a bug? Hibernate is clearly working and available here.

I am not aware of why the "Hibernate" option does not show in the menu after configuring it to via the Control Panel GUI. What is the actual behavior on physical hardware, do we know? Can this be identified as a QEMU bug?

QE: Do you have the ability to confirm that this behavior differs from a physical installation of Windows 2012 R2?
Comment 12 Xiaoqing Wei 2014-11-19 00:14:40 EST
Hello guys,

I performed below test for Windows 2012 R2 on both UEFI and BIOS based firmwares, plus a SeaBios Based Win2012r2. 
though such interface thing should not relevant to firmware types:

per https://bugzilla.redhat.com/show_bug.cgi?id=995388#c0


Steps to Reproduce:
1. enable hibernate:
 powercfg /h on
 powercfg /a
The following sleep states are available on this system:
    Hibernate
    Fast Startup
2. go to Control Panel -> Hardware -> Power Options -> Change what the power buttons do -> When I press the power button: Hibernate 

                                                                                                                                                     ^^^^^^^^^   there's not hibernation option

* only * when goto the desktop, then press 'alt+f4', Windows will prompt what do you want to do next:
1) power off
2) reboot
3) hibernate

So I think this is a Windows interface policy, it dont suggest you to hibernate your machine through GUI.
then I did "shutdown /h" in cmd as Administrator

Yes, it hibernated, and when press power botten, it resumes, and system log could see it's from sleep state.



====================
SeaBIOS based Win 2012 R2 test:

boot a Win2012 R2 VM with scsi-hd and s3 s4 enabled as C#1 mentioned.

snip of xml
  <pm>
    <suspend-to-mem enabled='yes'/>
    <suspend-to-disk enabled='yes'/>
  </pm>

resulting qemu cmd line:

/usr/libexec/qemu-kvm -name win2k12r2_bios -S -machine pc-i440fx-rhel7.1.0,accel=kvm,usb=off -cpu SandyBridge,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff -m 2048 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 6ab1d0b8-1b6d-49f3-95c7-43c99b4714f1 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/win2k12r2_bios.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown \
\
\
-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 \
\
\
-boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -drive file=/home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none,aio=native -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:9f:d4:49,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -chardev spicevmc,id=charredir2,name=usbredir -device usb-redir,chardev=charredir2,id=redir2 -chardev spicevmc,id=charredir3,name=usbredir -device usb-redir,chardev=charredir3,id=redir3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on


then redo the steps to reproduce, still *no hibernation in shutdown menu*, only appeared after pressing 'alt-f4' on desktop.
the 'powercfg /a' in cmd could see hibernate also.


So, Based on above physical(uefi and bios based) and VM(seabios) test, I think this should be a Windows GUI policy, does nothing relevant with virtualization.




appending libvirt xml for Win2012 R2 Seabios based VM:

<domain type='kvm' id='10'>
  <name>win2k12r2_bios</name>
  <uuid>6ab1d0b8-1b6d-49f3-95c7-43c99b4714f1</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='yes'/>
    <suspend-to-disk enabled='yes'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='native'/>
      <source file='/home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='scsi' index='0'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:9f:d4:49'/>
      <source bridge='switch'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir3'/>
    </redirdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>
Comment 13 Xiaoqing Wei 2014-11-19 00:18:28 EST
(In reply to Xiaoqing Wei from comment #12)
> Hello guys,
> 
> I performed below test for Windows 2012 R2 on both UEFI and BIOS based
> firmwares, plus a SeaBios Based Win2012r2. 

Ah, I mean uefi and bios based physical machine :-)
on HP Compaq 8200 Elite MT (Dual firmware, both uefi and bios, switchable in configuration.)
Comment 14 John Snow 2014-11-19 10:11:14 EST
Thank you very much for the confirmation!

Closing as NOTABUG since this seems to be Windows Server GUI policy and a problem with informational consistency in Microsoft's product, not ours.

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