Bug 808527 - Check for guest agent presence when issuing command
Check for guest agent presence when issuing command
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-30 11:39 EDT by Michal Privoznik
Modified: 2012-12-25 03:47 EST (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-11.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:51:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michal Privoznik 2012-03-30 11:39:40 EDT
Description of problem:
Libvirt added support for qemu GA just recently. However, it is possible to stuck an API and therefore tear down whole daemon because when issuing GA command libvirt waits endlessly for its response.


Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. start guest with GA
2. kill GA within guest
3. issue any API involving GA, e.g.:
    virsh shutdown --mode agent DOMAIN
    virsh snapshot-create --disk-only --quiesce DOMAIN
  
Actual results:
virsh hangs

Expected results:
virsh should print error message

Additional info:
This bug has emerged from Bug 767333 and Bug 804210 because the functionality those two are requesting has been added. However, this bug covers problem one can hit in both of them.
Comment 4 dyuan 2012-04-06 04:35:07 EDT
Verified PASS with libvirt-0.9.10-10.el6.

# time virsh shutdown --mode agent rhel6
error: Failed to shutdown domain rhel6
error: internal error Guest agent not available for now


real	0m4.978s
user	0m0.007s
sys	0m0.007s

# virsh snapshot-create --disk-only --quiesce xp
error: argument unsupported: QEMU guest agent is not configured
Comment 5 dyuan 2012-04-06 05:33:56 EDT
For the comment 4, the snapshot-create is tested with windows guest xp without GA configured.

When I re-check it with a rhel guest with qemu-ga, but the guest is paused or stop qemu-ga in guest, the error msg doesn't make sense. Is that the expected result ?

pause the guest, then issue snapshot-create:
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     rhel6-q                        paused

# virsh snapshot-create --disk-only --quiesce rhel6-q
error: An error occurred, but the cause is unknown


stop qemu-ga in guest, then issue snapshot-create:
# virsh snapshot-create --disk-only --quiesce rhel6-q
error: An error occurred, but the cause is unknown
Comment 6 Michal Privoznik 2012-04-06 06:01:02 EDT
No it is not. However, since this is restricted to snapshot-create only, I think we should leave this VERIFIED and re-open bug 804210 so I can post patch.
Comment 7 dyuan 2012-04-06 06:14:17 EDT
(In reply to comment #6)
> No it is not. However, since this is restricted to snapshot-create only, I
> think we should leave this VERIFIED and re-open bug 804210 so I can post patch.

Confirmed with assignee on irc.

The snapshot is rejected for the paused guest in bug 804210, I'll keep it as VERIFIED.
For this bug, I re-assign it for the better msg should be returned when check for guest agent presence.
Comment 8 Michal Privoznik 2012-04-06 07:02:47 EDT
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2012-April/msg00252.html
Comment 10 dyuan 2012-04-12 03:16:16 EDT
Verified PASS with libvirt-0.9.10-11.el6.

# virsh snapshot-create --disk-only --quiesce rhel6-q
error: internal error Guest agent not available for now

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     rhel6-q                        running

# virsh suspend rhel6-q
Domain rhel6-q suspended

# virsh snapshot-create --disk-only --quiesce rhel6-q

error: internal error Guest agent not available for now

# virsh list 
 Id    Name                           State
----------------------------------------------------
 2     rhel6-q                        paused

# virsh resume rhel6-q
Domain rhel6-q resumed
Comment 11 dyuan 2012-04-28 04:14:24 EDT
I just add comment in this bug because the comm 53 in bug 766958 is related to this bug. Too many comments there but it's okay for us to track the following issue in both 2 bugs.

The issue in comm 48 of bug 766958:

start the qemu-ga via # service qemu-ga start, dompmsuspend will fail.

# virsh dompmsuspend rhel6-q mem
error: Domain rhel6-q could not be suspended
error: internal error unable to execute QEMU command 'guest-suspend-ram': unknown QEMU command error

start the qemu-ga via # /usr/bin/qemu-ga start, dompmsuspend is okay.

# virsh dompmsuspend rhel6-q mem
Domain rhel6-q successfully suspended

For qemu-kvm, if you send 'guest-ping' first and then send 'guest-suspend-ram', it will be okay. Please refer to bug 816893.
Comment 13 errata-xmlrpc 2012-06-20 02:51:41 EDT
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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html
Comment 14 zhenfeng wang 2012-12-25 03:47:00 EST
Now, in pkg qemu-guest-agent-win32-0.12.1.2-2.346.el6.x86_64.rpm  we can do the s3/s4 in windows guest based the windows guest agent supported commands list
supported commands:
"guest-info"
"guest-ping"
"guest-sync-delimited"
"guest-sync"
"guest-shutdown" (include shutdown,reboot,halt)
"guest-suspend-disk"
"guest-suspend-ram"
Since there was a bug 888716 over there ,so the command "guest-susend-disk "not work well so far

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