Bug 1016533

Summary: virsh shutdown does not shut the guest
Product: [Community] Virtualization Tools Reporter: Deepti <deeptik>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, berrange, cshastri, lagarcia, pkrempa
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-10-08 10:26:36 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:

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