From 4ff0f451bd00556a11e66b0d04441dd4df15ead6 Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 28 Apr 2023 14:32:08 +0200 Subject: [PATCH] rbd: don't specify allow-shrink flag It was introduced by commit 4b7dd9d ("allow --allow-shrink on RBD resize"), but doesn't give a rationale. A mail gives more[0], indicating that the user also uses the function to shrink images. However, the volume_resize function is only reachable via the resize API endpoints for VMs and containers, which have an explicit check to disallow shrinkage. If somebody really wants to shrink the image, just let them use the storage's tools directly. Calling into Proxmox VE's perl functions directly is not supported. [0]: https://lists.proxmox.com/pipermail/pve-devel/2016-November/024077.html Signed-off-by: Fiona Ebner --- src/PVE/Storage/RBDPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm index 73703fb..9d59a14 100644 --- a/src/PVE/Storage/RBDPlugin.pm +++ b/src/PVE/Storage/RBDPlugin.pm @@ -779,7 +779,7 @@ sub volume_resize { my ($vtype, $name, $vmid) = $class->parse_volname($volname); - my $cmd = $rbd_cmd->($scfg, $storeid, 'resize', '--allow-shrink', '--size', ($size/1024/1024), $name); + my $cmd = $rbd_cmd->($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $name); run_rbd_command($cmd, errmsg => "rbd resize '$volname' error"); return undef; } -- 2.39.2