KVM/Qemu Guest Shutdown problems

5,734

Solution 1

Check that acpid is running inside the guests. If it isn't you need to install the acpid package. This is what receives the ACPI power button signal from KVM and causes the guest to shut itself down.

Solution 2

For CentOS.6.3 this worked well:

# yum -y install acpid; /etc/init.d/acpid start; chkconfig --level 235 acpid on;
Share:
5,734
Gaia
Author by

Gaia

SOreadytohelp

Updated on September 18, 2022

Comments

  • Gaia
    Gaia over 1 year

    on both host and guest running CentOS 6.3 with KVM/Qemu virtualization, I have the following scenarios:

    1. "virsh shutdown kvm1" did not shutdown at all. virsh lists guest as running.
    2. "service libvirt-guests stop" did not shutdown in 280 seconds (shutdown_timeout=300. on_shutdown=shutdown)
    3. "shutdown now" from within guest, guest becomes unreachable. virsh lists guest as running, though it could not connect to it.
    4. "shutdown -h now" from within guest works.
    5. "shutdown -r now" from within guest works.

    Libvirt logs show nothing for the first 3 scenarios. I can pause the guest fine.

    Grub doesnt have acpi=off. ACPI was installed after the reply by @mgorven below. There is nothing on guest logs regarding ACPI aside from these entries from /var/log/messages. It is puzzling to me that there are entries regarding ACPI since it was not installed up until the last line of the log.

    Bottom line, I cannot shutdown from outside the guest. What do I check to figure out what is going on?

  • Gaia
    Gaia over 11 years
    "virsh shutdown domain" did nothing with acpi installed on the guest domain.
  • Michael Hampton
    Michael Hampton over 11 years
    @Gaia What on earth is an Atomic Rocket Turtle? I would always suspect strangeness in a niche distribution like that.
  • Gaia
    Gaia over 11 years
    @MichaelHampton, sorry I mean ASL by www.atomicorp.com (ART is their repo)
  • daff
    daff over 11 years
    Have you made sure the acpid daemon is actually running after installing the package?
  • Gaia
    Gaia over 11 years
    @daffI did, I restarted the guest after installing the package and things work fine (virsh is able to shutdown). what I don't understand is all the ACPI messages in the log (see OP) before ACPI was installed, but that doesnt matter much...
  • cbliard
    cbliard almost 11 years
    Note for Debian users: if you disabled installation of Recommended packages, then acpid alone does not much because it only contains the binaries. You need to install acpi-support-base package to handle power button ACPI events. For Ubuntu, acpid contains both binaries and base event handlers and is sufficient.