Hello Daniel,
Am Dienstag, 15. Juli 2008 21:17:04 schrieb Daniel P. Berrange:
On Sat, Jul 12, 2008 at 10:25:01PM +0200, Matthias Pfafferodt wrote:
> Hello,
>
> there is the possibility to autostart a (qemu/kvm) domain. If libvirtd is
> stopped this domain is killed and the filesystem is in a unclean state. I
> miss the possible of an 'autostop' option that will shutdown a (qemu/kvm)
> domain if libvirtd is stopped.
>
> I changed the init script of my system (opensuse 11.0) to implement
> the 'autostop' option. Is there a simpler solution? Do you have tips how
> to improve the script?
This functionality doesn't belong in the initscripts. It needs to be done
as part of the individual hypervisor drivers, so for example, it can be
delegated to XenD daemon, and behaviour controlled on a per VM basis
via the API. Many OS don't even use the initscript managing the libvirtd
daemon via a service management framework, like Upstart.
I know that the init script of libvirt is not the right place. I would like to
have an option within libvirt to do this. The script I have will work for
kvm, but for xen ... ?
If you say 'per VM basis' does this mean an option within the xml definition
of VM is the right way to go? On start / stop of libvirtd the corresponding
actions would have to be initiated (like shutdown all kvm VMs). So a
framework is needed to define which actions should be done an start / stop of
the daemon and an implementation for each hypervisor.
Kind regards
Matthias
Daniel