Bug 959017
Summary: | virsh shutdown domain | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dean Hunter <deanhunter> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 18 | CC: | berrange, clalancette, crobinso, eblake, itamar, jforbes, jyang, laine, libvirt-maint, veillard, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-05-08 22:18:45 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: | 744077 | ||
Bug Blocks: |
Description
Dean Hunter
2013-05-03 02:10:48 UTC
This is not a libvirt bug. 'virsh shutdown' requires guest cooperation; but your guest is not wired up to react to either ACPI events or qemu-guest-agent commands, therefore it is not cooperating. The simplest thing for you to do might be installing acpid in your guest. Meanwhile, you're not the first person to request that GNOME reconsider their default of ignoring ACPI requests (the default was changed back in Fedora 15; older versions of Fedora shut down just fine in reaction to an ACPI event). Thank you for your prompt response. I could not imagine that this might be a "bug" that has slipped through, but, as with several other long standing differences I have discovered, it is very difficult to find solid information about how to work around the problem. Everybody else seems to already know what to do and why and not say much about it. So you are referring to the "--mode" parameter of the virsh shutdown command: shutdown domain [--mode acpi|agent] And you are saying that the default Gnome desktop install on Fedora 18 does not provide a service to respond to either alternative? And you recommend installing acpid on the guest. Can you direct me to any documentation of this situation, other that the man pages? I would like to better understand where else I might find this or related problems. bug 744047 details my request for a change in GNOME default reaction to ACPI when in a VM - but it hasn't gone anywhere fast. THere are also other BZs about getting guest-agent wired up by default, although I didn't search for them just now - this would involve getting the agent installed by default even in live images, and having packages like virt-install wire up an agent by default when installing a known Fedora guest. For my own fedora guests, I install dconf-editor, then tweak org.gnome.settings-daemon.plugins.power button-power to be interactive instead of its default of suspend (since suspend on a VM isn't as useful as it is bare-metal); this at least lets me get by without installing acpid if I'm logged in (but doesn't seem to help if the guest is still on the gdm screen instead of a session). I also think using the guest-agent is better than using ACPI, but that's more involved to set up correctly (http://libvirt.org/formatdomain.html, search for guest_agent for an example). But I am likewise disappointed at the lack of a succinct documentation page on the issue, so if nothing else, this bug can serve as a reminder that libvirt's web site needs a page that covers the pros and cons of the various shutdown methods. (In reply to comment #3) > bug 744047 details my request for a change in GNOME default reaction to ACPI > when in a VM - but it hasn't gone anywhere fast. Typo: bug 744077 was intended. I googled "virsh shutdown acpi" and found some warnings about security concerns with the use of acpid. I did not see much about configuring acpi so I did: ssh root@fedora18 yum install acpid --assumeyes ssh root@fedora18 reboot then tried to shutdown again: virsh shutdown Fedora18 --agent acpi but still it will not shutdown. (In reply to comment #5) > I googled "virsh shutdown acpi" and found some warnings about security > concerns with the use of acpid. I did not see much about configuring acpi so > I did: > > ssh root@fedora18 yum install acpid --assumeyes > ssh root@fedora18 reboot > > then tried to shutdown again: > > virsh shutdown Fedora18 --agent acpi '--agent acpi' shouldn't be needed - by default, if you omit --agent, libvirt should try all possible shutdown methods (--agent is more to force an explicit method, even if it is lower priority than what libvirt would attempt first). > > but still it will not shutdown. Have you checked that the service is actually running in your guest? You may need to do something like 'systemctl enable acpid'. While libvirt can't document how to make ALL guests react to ACPI events, we can at least put together a page that mentions common settings for common guests (such as Fedora and Windows). At least we HAVE documented that shutdown requires guest cooperation, and that guests may ignore the request: http://libvirt.org/html/libvirt-libvirt.html#virDomainShutdownFlags along with the alternative of virDomainDestroy ('virsh destroy') as the alternative that forces a guest to stop without requiring cooperation. Yes, I checked that acpid.service was running. The install actually enabled the service (!) and the during the following reboot it started. I learned virsh from the man pages, where I learn most command line activities. Perhaps: "This coordinates with the domain OS to perform graceful shutdown, so there is no guarantee that it will succeed, ...." could be supplemented with a reference that is more specific and has a date. It is hard to decode many years of historical references and determine what is accurate on this platform. But more than anything else, "I want it to just work." I am now attempting to configure qemu-guest-agent. qemu-guest-agent works Thank you for your help. I have added: --channel unix,path=/var/lib/libvirt/qemu/guest.agent,mode=bind,target_type=virtio,name=org.qemu.guest_agent.0 \ to my virt-install script and: yum install qemu-guest-agent --assumeyes to the Anaconda Kickstart post script. But of course what works on Fedora 18 causes an SELinux alert and fails on Fedora 19: https://bugzilla.redhat.com/show_bug.cgi?id=959639 Closing as NOTABUG since this a known issue as pointed out by Eric Instead of waiting for Gnome to implement ACPI, which I could not get to work, you might want to install the qemu-guest-agent when the domain is created and expand the man page for virt-install with an example of the required channel, as this is something you might have more control over. |