[virt-tools-list] Why there is no "autostop"?

Eric Blake eblake at redhat.com
Thu Mar 13 20:42:06 UTC 2014


On 03/13/2014 02:33 PM, Peng Yu wrote:
> 
> OK. I see the following file. I just need to change
> "ON_SHUTDOWN=suspend" to "ON_SHUTDOWN=shutdown"? After I change it,
> then I can restart the host. How to know whether the guested have been
> gracefully shutdown or not? With "ON_SHUTDOWN=shutdown", the host will
> be shutdown only after all the guests are shutdown? Thanks.

The point of the libvirt-guests service is to make sure that guests are
in a safe state before allowing the host to shutdown.  Personally, I
like the ON_SHUTDOWN=suspend action, because when I next reboot, the
guests automatically pick up running where they last left off (modulo
incorrect times, depending on clock policy and guest tolerance to big
gaps in clock ticks); but yes, ON_SHUTDOWN=shutdown will hold the host
from shutting down until either all guests complete shutdown or until
timeouts expire (remember, graceful guest shutdown requires guest
cooperation, and not all guests cooperate).

> pengy at hydrogen:/usr$ grep ON_SHUTDOWN /usr/lib/libvirt/libvirt-guests.sh

No, that's not the file you want to edit.  Instead, figure out what file
gets sourced a few lines later.  On my Fedora machine,
/usr/libexec/libvirt-guests.sh contains:

sysconfdir="/etc"
...
test -f "$sysconfdir"/sysconfig/libvirt-guests &&
    . "$sysconfdir"/sysconfig/libvirt-guests

so my modifications would be to /etc/sysconfig/libvirt-guests.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140313/9e03f9c9/attachment.sig>


More information about the virt-tools-list mailing list