since for qcow2, qemu-img expects a multiple of 512 and for raw it aligns to 512 with a warning, which we avoid
Signed-off-by: Fabian Ebner <f.eb...@proxmox.com> --- PVE/Storage/Plugin.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 0c39cbd..7382140 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -747,6 +747,11 @@ sub volume_resize { my $format = ($class->parse_volname($volname))[6]; + # for qcow2 images 'qemu-img resize' requires that the size + # is aligned to 512 and for raw images we avoid a warning + my $padding = (512 - $size % 512) % 512; + $size = $size + $padding; + my $cmd = ['/usr/bin/qemu-img', 'resize', '-f', $format, $path , $size]; run_command($cmd, timeout => 10); -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel