[pve-devel] [PATCH guest-common 3/3] fix #6808: abstract config: snapshot delete: improve error when snapshot on volume is missing

Fiona Ebner f.ebner at proxmox.com
Fri Sep 19 18:16:36 CEST 2025


In case of a ZFS volume the message would be a rather unhelpful:
> zfs error: could not find any snapshots to destroy; check snapshot names.

Mention the volume name and that the force parameter can be used if
desired.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/AbstractConfig.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm
index d403021..23f62d4 100644
--- a/src/PVE/AbstractConfig.pm
+++ b/src/PVE/AbstractConfig.pm
@@ -1014,8 +1014,11 @@ sub snapshot_delete {
                     );
                 };
                 if (my $err = $@) {
-                    die $err if !$force;
-                    warn $err;
+                    my $volid_key = $class->volid_key();
+                    my $volid = $volume->{$volid_key};
+                    my $msg = "Removing snapshot '$snapname' from volume $volid failed";
+                    die "${msg}, use '--force' to continue removal. Error was: $err" if !$force;
+                    warn "${msg}, proceeding because '--force' was specified. Error was: $err";
                 }
             }
 
-- 
2.47.3





More information about the pve-devel mailing list