[pve-devel] applied: [PATCH qemu-server] create_efidisk: poll the real size after volume creation

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Dec 4 18:44:10 CET 2019


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 <t.lamprecht at proxmox.com>
---
 PVE/QemuServer.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 865a89b..0d0e610 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 {
-- 
2.20.1





More information about the pve-devel mailing list