From 340dbcf730b05d2e2e5ff2a40926c9c1d63356c1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 4 Dec 2019 18:40:31 +0100 Subject: [PATCH] create_efidisk: poll the real size after volume creation some storage backends have bigger granularity than the default 128k size from the EFIVARS template file, so we actually need to poll the real created disk size, as it will be used to create the target volume for local storage migration on running VMs, if it's to small the target will be to small and migration will fail. Just a fix for newly created EFIDISKS, for others we need to rescan the size after we've got the migrate lock and write the updated info out, so that the target node has the correct one (protected from migrate lock). Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 865a89ba..0d0e6108 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -7078,8 +7078,9 @@ sub create_efidisk($$$$$) { PVE::Storage::activate_volumes($storecfg, [$volid]); qemu_img_convert($ovmf_vars, $volid, $vars_size_b, undef, 0); + my ($size) = PVE::Storage::volume_size_info($storecfg, $volid, 3); - return ($volid, $vars_size); + return ($volid, $size/1024); } sub vm_iothreads_list {