[pve-devel] [PATCH pve-docs 1/1] add pre/post-clone events to example hookscript

Stefan Hanreich s.hanreich at proxmox.com
Fri Sep 23 11:55:28 CEST 2022


Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 examples/guest-example-hookscript.pl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/examples/guest-example-hookscript.pl b/examples/guest-example-hookscript.pl
index adeed59..345b5d9 100755
--- a/examples/guest-example-hookscript.pl
+++ b/examples/guest-example-hookscript.pl
@@ -54,6 +54,18 @@ if ($phase eq 'pre-start') {
 
     print "$vmid stopped. Doing cleanup.\n";
 
+} elsif ($phase eq 'pre-clone') {
+
+    # Phase 'pre-clone' will run on the source machine before cloning a VM/CT
+
+    print "$vmid will be cloned.\n";
+
+} elsif ($phase eq 'post-clone') {
+
+    # Phase 'post-clone' will run on the source machine before cloning a VM/CT
+
+    print "$vmid successfully cloned.\n";
+
 } else {
     die "got unknown phase '$phase'\n";
 }
-- 
2.30.2





More information about the pve-devel mailing list