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 821622 - doc improvement for "virsh shutdown"
Summary: doc improvement for "virsh shutdown"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: 6.3
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-15 07:00 UTC by EricLee
Modified: 2012-05-16 13:56 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-16 13:56:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description EricLee 2012-05-15 07:00:32 UTC
Description of problem:
"man virsh" should write shutdown command will not effect until the acpi daemon started in the guest and "virsh shutdown" should give error info when acpid is not available with the option "--mode acpi"

Version-Release number of selected component (if applicable):
libvirt-0.9.10-18.el6.x86_64
qemu-kvm-0.12.1.2-2.292.el6.x86_64
kernel-2.6.32-270.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
Need:
Guest OS is greater than RHEL6(have acpi pkg installed).
Actions:
# virsh start raw
Domain raw started

run the command ASAP (before the acpi daemon started):
# virsh shutdown --mode acpi raw 
Domain raw is being shutdown
But it will not effect(guest will still running).

After a moment(after the acpi daemon started), rerun the command:
# virsh shutdown --mode acpi raw
Domain raw is being shutdown
And it start to shutdown the guest gracefully.

# man virsh
   ...
       shutdown domain-id [--mode acpi|agent]
           Gracefully shuts down a domain.  This coordinates with the domain OS to perform graceful
           shutdown, so there is no guarantee that it will succeed, and may take a variable length of
           time depending on what services must be shutdown in the domain.

           The exact behavior of a domain when it shuts down is set by the on_shutdown parameter in the
           domain’s XML definition.

           If domain-id is transient, then the metadata of any snapshots will be lost once the guest
           stops running, but the snapshot contents still exist, and a new domain with the same name
           and UUID can restore the snapshot metadata with snapshot-create.

           By default the hypervisor will try to pick a suitable shutdown method. To specify an
           alternative method, the --mode parameter can specify "acpi" or "agent".
   ...


Another environment :
Login to the guest, stop the acpid service:
#service acpid stop

Then rerun command:
# virsh shutdown raw
Domain raw is being shutdown

Actual results:
As below.

Expected results:
Could see something about this circumstances in "man virsh".

When acpid is stoped, the shutdown command should fail with error info like: "error: QEMU guest acpid is not available", but no effect with info "Domain raw is being shutdown" .

Additional info:
just like "--mode agent", when it was not configured shutdown will failed:
# virsh shutdown --mode agent qcow2
error: Failed to shutdown domain qcow2
error: argument unsupported: QEMU guest agent is not configured

Comment 2 Dave Allan 2012-05-16 13:56:25 UTC
The problem here is that libvirt doesn't know what's running in the guest.  It would be possible to hack qemu-ga to provide this information, but IMO that's not worth doing, since if you have qemu-ga, you can call it to shutdown the guest and avoid acpi entirely.  Since the virsh man page already documents that shutdown requires cooperation with the guest OS and is not guaranteed to succeed, I don't think there's anything that can be done here.


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