]> git.proxmox.com Git - pve-storage.git/commitdiff
rbd: don't specify allow-shrink flag
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 28 Apr 2023 12:32:08 +0000 (14:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Jun 2023 17:25:27 +0000 (19:25 +0200)
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 <f.ebner@proxmox.com>
src/PVE/Storage/RBDPlugin.pm

index 73703fb8d878eaff27bbe4dae0179b2a6e1ea9d5..9d59a14e1724b5eb75990845d327cd709f364a87 100644 (file)
@@ -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;
 }