Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1496475

Summary: Disable VM suspend/hibernate when VM XML sets suspend enabled='no'
Product: Red Hat Enterprise Linux 7 Reporter: Nisim Simsolo <nsimsolo>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED NOTABUG QA Contact: Lili Zhu <lizhu>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.4CC: dyuan, fjin, nsimsolo, rbalakri, xuzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-10 12:42:02 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:
Bug Depends On:    
Bug Blocks: 1437512    
Attachments:
Description Flags
engine.log
none
vdsm.log
none
qemu log none

Description Nisim Simsolo 2017-09-27 13:54:45 UTC
Description of problem:
Related to bug https://bugzilla.redhat.com/show_bug.cgi?id=1437512:
Currently when running systemctl suspend or systemctl hibernate from VM CLI shell, the VM enters into suspend/hibernate mode. 
The aforementioned bug requires libvirt API to disable S3/S4 when VM XML sets
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.0-0.0.master.20170926175518.git0d20200.el7.centos
vdsm-4.20.3-105.git216d21d.el7.centos.x86_64
libvirt-client-3.2.0-14.el7_4.3.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Browse ovirt webadmin and run VM with RHEL 7.4 OS.
2. Open VM console and run 'systemctl suspend' or 'systemctl hibernate' command.
3.

Actual results:
VM enters into suspend/hibernate mode.

Expected results:
VM should ignore suspend/hibernate commands from the VM itself.

Additional info:
vdsm (2017-09-27 16:09:08,780+0300), qemu and engine logs attached

Comment 2 Nisim Simsolo 2017-09-27 13:57:17 UTC
Created attachment 1331453 [details]
engine.log

Comment 3 Nisim Simsolo 2017-09-27 13:59:01 UTC
Created attachment 1331454 [details]
vdsm.log

Comment 4 Nisim Simsolo 2017-09-27 14:01:19 UTC
Created attachment 1331455 [details]
qemu log

Comment 5 Jaroslav Suchanek 2017-09-29 11:30:10 UTC
I believe libvirt does its job just fine. Is it qemu/guest kernel which does
not care?

Comment 6 Martin Kletzander 2017-09-29 12:14:28 UTC
When you check the qemu command line, we add:

  -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1

which disables the fields in what ACPI announces the BIOS can do (roughly).  However the OS can choose (and lot of them do) to circumvent it by other means.  For example if the HW cannot do suspend, you can just turn off everything you can while leaving the PC running.  If the HW does not support S4, the sustem may choose to hibernate and then switch to S5 or completely turn off.  That way systems will look like they can do more than hardware.  Even though it seems like it, we cannot control how the guest OS will behave.

Maybe try asking systemd whether there is an option that would only allow you to enter states advertised by the ACPI, or kernel if that is where the workaround occurs.  However the host cannot, by design, fully control this.  Unless you switch this BZ to another component in order to seek some resolution, I'm going to have to close it as NOTABUG.

Comment 7 Martin Kletzander 2017-10-10 12:42:02 UTC
Closing this per comment #6