volume_resize: align size to 1 KiB

1. Avoids the error
qemu-img: The new size must be a multiple of 512
for qcow2 disks.
2. Because volume_import expects disk sizes to be a multiple of 1 KiB.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2020-02-19 11:31:31 +01:00
committed by Thomas Lamprecht
parent 462537a270
commit c72155735d

View File

@ -209,6 +209,9 @@ sub volume_size_info {
sub volume_resize {
my ($cfg, $volid, $size, $running) = @_;
my $padding = (1024 - $size % 1024) % 1024;
$size = $size + $padding;
my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) {
my $scfg = storage_config($cfg, $storeid);