[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 12:01:53 CEST 2022


On 9/23/22 11:55, Stefan Hanreich wrote:
> 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
> +
copy/paste error. I'll fix in v2 after a review?
> +    print "$vmid successfully cloned.\n";
> +
>   } else {
>       die "got unknown phase '$phase'\n";
>   }





More information about the pve-devel mailing list