Shutting down xen domUs without saving them

Per default, CentOS 5.3 saves a domU’s state when the hypervisor is shut down. In principle this a nice behaviour: The domU will restore its state automagically when the hypervisor comes up again and just continue working. But there are some services (e.g. mldonkey) that don’t like to be restored and refuse to work (i.e. keep in a blocked state forever).

The easiest way of fixing this, is to shut down the domUs gracefully with the hypervisor. In CentOS (as in probably most other distros as well) you can change xen’s shutdown behaviour in /etc/sysconfig/xendomains

## Type: string
## Default: /var/lib/xen/save
# Directory to save running domains to when the system (dom0) is
# shut down. Will also be used to restore domains from if # XENDOMAINS_RESTORE
# is set (see below). Leave empty to disable domain saving on shutdown 
# (e.g. because you rather shut domains down).
# If domain saving does succeed, SHUTDOWN will not be executed.

All we have to do is empty the value of the XENDOMAINS_SAVE variable, so SHUTDOWN will be executed instead.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.