From 84821d151518b3b9e67fbaa6f971b7c1c266599e Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 30 Apr 2019 13:09:21 +0000 Subject: [PATCH] followup: do not query size of image we just created we know the size, and even if a storage plugin pads this up (it mustn't alloc something smaller, but something bigger can be OK) we know that our 4MB is OK, and can only be used anyway to make this compatible between storage plugins. Signed-off-by: Thomas Lamprecht --- PVE/QemuServer/Cloudinit.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm index 981e6afd..6b99b462 100644 --- a/PVE/QemuServer/Cloudinit.pm +++ b/PVE/QemuServer/Cloudinit.pm @@ -36,8 +36,9 @@ sub commit_cloudinit_disk { if ($size <= 0) { $volname =~ m/(vm-$vmid-cloudinit(.(qcow2|raw))?)/; my $name = $1; - my $d = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, 4 * 1024); - $size = PVE::Storage::file_size_info($iso_path); + $size = 4 * 1024; + PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, $size); + $size *= 1024; # vdisk alloc takes KB, qemu-img dd's osize takes byte } my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); -- 2.39.5