<div dir='auto'>How can I automatically revert to a snapshot after the guest is stopped?<div dir="auto"><br></div><div dir="auto">/etc/libvirt/hooks/qemu </div><div dir="auto">#!/bin/sh </div><div dir="auto">name="<span class="money">$1</span>" </div><div dir="auto">action="<span class="money">$2</span>" </div><div dir="auto">if [ "$name" = "name" ]; then </div><div dir="auto"> virsh snapshot-revert "$name" --snapshotname "snapshot1" </div><div dir="auto">fi</div><div dir="auto"><br></div><div dir="auto">I tried this which resulted in a deadlock, then I saw the warning further down the page.</div></div>
Peter Krempa
2017-Jul-26 16:27 UTC
Re: [libvirt-users] automatically reverting to a snapshot
Please configure your mail client to send plain-text version to mailing lists ... On Tue, Jul 25, 2017 at 16:08:58 +0100, Dirty Dan wrote:> <div dir='auto'>How can I automatically revert to a snapshot after the guest is stopped?<div dir="auto"><br></div><div dir="auto">/etc/libvirt/hooks/qemu</div><div dir="auto">#!/bin/sh </div><div dir="auto">name="<span class="money">$1</span>" </div><div dir="auto">action="<span class="money">$2</span>" </div><div dir="auto">if [ "$name" = "name" ]; then </div><div dir="auto"> virsh snapshot-revert "$name" --snapshotname "snapshot1" </div><div dir="auto">fi</div><div dir="auto"><br></div><div dir="auto">I tried this which resulted in a deadlock, then I saw the warning further down the page.</div></div> The hook documentation explicitly states that no calls to libvirt shoudl be executed from the hook. You can start a process in background, which will terminate the hook and that process should be able to do libvirt calls.
Seemingly Similar Threads
- rsync --delete with empty source folder for fast snapshot deletion: Permissions of hardlinked files are changed to 644. Workaround?
- rsync --delete with empty source folder for fast snapshot deletion: Permissions of hardlinked files are changed to 644. Workaround?
- snapshot troubles
- Re: snapshot of a raw file - how to revert ?
- Find the difference between two snapshots