[Pkg-libvirt-maintainers] Bug#501155: Bug#501155: Please add script for automatic restart of kvm-based instances

Andreas Barth aba at not.so.argh.org
Sun Oct 5 12:59:52 UTC 2008


* Guido Günther (agx at sigxcpu.org) [081005 14:52]:
> thanks a lot - this is an area where libvirt currently isn't doing too
> well! I wonder if we should hook this directly into
> /etc/init.d/libvirt-bin in the long run.

I would assume so, this is just a "fast hack".

> We could even offer to either
> shutdown or suspend the vms via (/etc/default/libvirt-bin)
> shutdown_action="shutdown|suspend" then. I'm currently discussing with
> upstream what would be the best thing to do - e.g. in case of a restart
> we should simply keep the VMs running.

Yep. Though I would like to see some new invocations for libvirt-bin,
like "doms-destroy", "doms-suspend", "doms-resume", "doms-shutdown" that
do the relevant action (and "stop" invokes one of them, depending on the
default settings).


> Below is some minor nitpicking:
> 
> [..snip..] 
> >     for domain in ${suspenddir}/*dump; do
> >         if [ -f $domain ]; then
> >             domain=$(basename $domain .dump)
> >             echo "resuming $domain ..."
> >             virsh restore ${suspenddir}/${domain}.dump && rm ${suspenddir}/${domain}.dump
> Do we want to keep the dump file around in case the restore failed?

I think we should.

> Should we add some lsb logging in case the restore failed?

Probably.


> >         state=$(virsh domstate $domain)
> >         if [ "$state" == "running" ]; then
> We probably want to pass the URI here like "virsh -c qemu:///system" so
> we don't clash with people using xen and we also don't handle
> "transient" domains (virsh create).

yep.


Cheers,
Andi





More information about the Pkg-libvirt-maintainers mailing list