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 872424 - running pmsuspend on a pmsuspended domain will get unclear error
Summary: running pmsuspend on a pmsuspended domain will get unclear error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-02 03:36 UTC by zhpeng
Modified: 2016-04-26 16:25 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.14-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:36:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 872573 0 unspecified CLOSED dompmsuspend doesn't work twice 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Internal Links: 872573

Description zhpeng 2012-11-02 03:36:12 UTC
Description of problem:
run pmsuspend guest --target mem/disk twice will get unclear error.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-6.el6.x86_64

How reproducible:
100%

Steps to Reproduce:

1.prepare a guest with qemu-ga ENV
2.
# virsh dompmsuspend aaa --target mem
Domain aaa successfully suspended
# virsh dompmsuspend aaa --target mem
error: Domain aaa could not be suspended
error: Guest agent is not responding: Guest agent not available for now     ----->
                                                                            Should warn something like:
                                                                            error: Domain aaa status is pmsuspended


I think guest status should be dompmsuspend after S4 operation. For now it's "shut off":

# virsh dompmsuspend aaa --target disk
Domain aaa successfully suspended
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     aaa                            shut off
 -     qcow                           shut off
 -     rhel63q                        shut off
 -     win7                           shut off

# virsh dompmsuspend aaa --target disk            ----> run it again, error is not clear either.
error: Domain aaa could not be suspended
error: Requested operation is not valid: domain is not running

  
Actual results:
As steps

Expected results:
More humanity

Additional info:
The direct reason of this is "agent not responding" or "guest is donw", But libvirt should check if the guest is in S3/S4 status first, then give a better error msg.

Comment 2 Michal Privoznik 2012-11-15 11:02:42 UTC
This is result of us not checking the state of domain when executing qemuDomainPMSuspendForDuration(). The proper fix is to check it after we obtain job and before we start talking to qemuAgent.

Currently, there is no such check and with current implementation we send something like ping to guest agent to tell if it's there or not (this is done with timeout though). And since domain is in s3 state, the guestAgent won't reply, we timeout and report the error about unavailable guest agent.

Comment 6 Jiri Denemark 2014-04-04 21:36:49 UTC
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product.

Comment 8 Ján Tomko 2015-02-27 15:31:12 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2015-February/msg01219.html

Comment 9 Ján Tomko 2015-03-02 07:20:10 UTC
commit 723522328f2d92e4c2d5de35b3b3ec0302bb06ac
Author:     Ján Tomko <jtomko>
CommitDate: 2015-03-02 08:07:56 +0100

    Check if domain is running in qemuDomainAgentIsAvailable
    
    If the domain is not running, the agent will not respond.
    Do not even try.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=872424

git describe: v1.2.13-20-g7235223

Comment 11 zhenfeng wang 2015-05-27 06:14:24 UTC
Verify this bug with libvirt-1.2.15-2.el7.x86_64, Verify steps as following
1.Start a guest agent configured, After guest start successfully, we could see the guest agent stay in "connected" status.

# virsh start 7.0
Domain 7.0 started

# virsh dumpxml 7.0 |grep agent -A3
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

2.Do S3 with the guest, Then the guest agent will run into "disconnected".
# virsh dompmsuspend 7.0 --target mem
Domain 7.0 successfully suspended
# virsh list
 Id    Name                           State
----------------------------------------------------
 33    7.0                            pmsuspended

# virsh dumpxml 7.0 |grep agent -A3
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

3.Re-excute S3 or other commands which depends on guest agent, all of them could get expect error
# virsh dompmsuspend 7.0 --target mem
error: Domain 7.0 could not be suspended
error: Guest agent is not responding: QEMU guest agent is not connected

# virsh dompmsuspend 7.0 --target disk
error: Domain 7.0 could not be suspended
error: Guest agent is not responding: QEMU guest agent is not connected

# virsh domtime 7.0
error: Guest agent is not responding: QEMU guest agent is not connected

4.Wakeup the guest, the guest agent's state will come back to "connected" status, also we could scuccessfully excute the virsh commands which depends on guest agent

# virsh dompmwakeup 7.0
Domain 7.0 successfully woken up
# virsh list
 Id    Name                           State
----------------------------------------------------
 33    7.0                            running

# viursh dumpxml 7.0
-bash: viursh: command not found
[root@zhwangrhel71 ~]# virsh dumpxml 7.0 |grep agent -A3
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

# virsh domtime 7.0 --pretty
Time: 2015-05-27 06:01:04

5.Do S4 with guest agent, could excute successfully and get expect error while re-excute it while it finish the first time
# virsh dompmsuspend 7.0 --target disk
Domain 7.0 successfully suspended


# virsh dompmsuspend 7.0 --target disk
error: Domain 7.0 could not be suspended
error: Requested operation is not valid: domain is not running

According to the upper steps, mark this bug verified

Comment 13 errata-xmlrpc 2015-11-19 05:36:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


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