I've got a KVM guest that won't shut down from virsh or from virt-manager. Most everything I've read says to install ACPI on the guest and do a bunch of configuring on the host to make this work. Is there any reason that I can't halt the guest from a shell running in the guest and then do the "virsh shutdown " command from the server? I want to avoid "virsh destroy" as I understand that "pulling the plug" is a bad idea, i.e. could corrupt the disk.
1 Answer
I'm using debian as KVM guest. It has qemu-guest-agent package that install guest agent without a pain. On the libvirt side I need to add small chunk of xml configuration to enable it:
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
From now on you can use virsh shutdown --mode agent
to shutdown the guest gracefully
virsh destroy
it -virsh shutdown
won't have any more effect in halted stated than it will in running state. The correct solution is to get ACPI working on the guest, and there's no good reason not to do that.