Bug 1016533 - virsh shutdown does not shut the guest
Summary: virsh shutdown does not shut the guest
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-08 10:22 UTC by Deepti
Modified: 2014-05-14 15:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-08 10:26:36 UTC


Attachments (Terms of Use)

Description Deepti 2013-10-08 10:22:25 UTC
Description of problem:

Executing virsh shutdown <guest name> on a running guest does not shut the guest, but instead the guest still continues to be running.

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

libvirtd --version
libvirtd (libvirt) 1.1.3

qemu-system-x86_64 --version
QEMU emulator version 1.6.50, Copyright (c) 2003-2008 Fabrice Bellard


How reproducible:
Always


Steps to Reproduce:
1. Start a guest using the virsh start <guest_name>
2. Make sure the guest is running using virsh list virsh list --state-running
3. Shutdown the guest using virsh shutdown <guest name>
4. The shutdown of the guest should bring the guest down and virsh list --inactive should list the guest 

Actual results:
The guest is still in the running state and the virsh list --state-running shows the guest.

Expected results:
The guest should go in shutoff state and virsh list --state-running should not show the guest instead virsh list --inactive should list the guest with guest being in the shut off state.

Comment 1 Daniel Berrangé 2013-10-08 10:26:36 UTC
The 'shutdown' command is merely a "polite request to shutdown". It requires that the guest OS co-operate, so it is never guaranteed to suceed. For KVM guests, it will trigger an ACPI power button event, or talk to the QEMU guest agent if it is available. For LXC guest it will use /dev/initctl in the guest, or send SIGTERM.  So if shutdown is not doing anything, then your guest OS needs re-configuring to honour one of these requests as appropriate.

Comment 2 chandrashekar shastri 2013-10-08 10:34:27 UTC
We tried "virsh shutdown --domain 11 --mode acpi" that is also not working.

Comment 3 Peter Krempa 2013-10-08 11:13:39 UTC
your guest probably doesn't have acpid installed


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