The hookscripts for pre- and post- snapshot work as intended. I tested creating snapshots in the GUI and on the CLI without finding any problems. When the hookscript fails the behavior was as I would expect it: An error in 'pre-hookscript' fails the whole task. An error in the 'post-hookscript' states that an error in the hookscript occured, but still ends with 'TASK OK', with the snapshot being created.
One general suggestion: When the 'post-snapshot' hook fails it would be nice if a warning could be printed. As the snapshot still succeeds in this case, just looking at the task log list, it looks like the task finished without any problems. This would require some changes in 'exec_hookscript' and probably for other 'post-x' hooks as well, though, this is not in the scope of these patches. I just thought to put it somewhere. So, consider this series Tested-by: Daniel Tschlatscher <d.tschlatsc...@proxmox.com> On 9/22/22 13:54, Stefan Hanreich wrote: > This patch adds hooks that run when the user creates a snapshot from the Web > UI > / CLI. I have tested this with both VMs/CTs via Web UI and CLI. Are there any > other places where the hook should get triggered that I missed? > > pve-guest-common: > > Stefan Hanreich (1): > add pre/post-snapshot hooks > > src/PVE/AbstractConfig.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > pve-docs: > > Stefan Hanreich (1): > add pre/post snapshot events to example hookscript > > examples/guest-example-hookscript.pl | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel