all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC storage] work-around #6543: do not use preallocation for qcow2 on top of LVM
Date: Tue, 22 Jul 2025 17:31:50 +0200	[thread overview]
Message-ID: <20250722153231.107955-1-f.ebner@proxmox.com> (raw)

With the default preallocation=metadata for qcow2, the image can grow
more than 'qemu-img measure' reports, see bug #6543. Currently, the
option does not seem to make a difference with 'qemu-img measure', so
that needs to be further investigated. Once it's safe to add
preallocation back here, it should also be re-added to the
qemu_img_resize() call. Also, the option should be passed along to the
qemu_img_measure() call, because otherwise, it wouldn't match the
actual creation options.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

RFC, because this stop-gap might not even be complete (but it's the
best I have right now). Needs to be furhter investigated in any case.

 src/PVE/Storage/LVMPlugin.pm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 8be2a10..fba592d 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -568,8 +568,14 @@ my sub lvm_qcow2_format {
     $class->activate_volume($storeid, $scfg, $name);
     my $path = $class->path($scfg, $name, $storeid);
 
+    # TODO with the default preallocation=metadata for qcow2, the image can grow more than
+    # 'qemu-img measure' reports, see bug #6543. Currently, the option does not seem to make a
+    # difference with 'qemu-img measure', so that needs to be further investigated. Once it's safe
+    # to add preallocation back here, it should also be re-added to the qemu_img_resize() call.
+    # Also, the option should be passed along to the qemu_img_measure() call, because otherwise,
+    # it wouldn't match the actual creation options.
     my $options = {
-        preallocation => PVE::Storage::Plugin::preallocation_cmd_opt($scfg, $fmt),
+        # preallocation => PVE::Storage::Plugin::preallocation_cmd_opt($scfg, $fmt),
     };
     if ($backing_snap) {
         my $backing_volname = get_snap_name($class, $name, $backing_snap);
@@ -927,8 +933,7 @@ sub volume_resize {
     );
 
     if (!$running && $format eq 'qcow2') {
-        my $preallocation = PVE::Storage::Plugin::preallocation_cmd_opt($scfg, $format);
-        PVE::Storage::Common::qemu_img_resize($path, $format, $size, $preallocation, 10);
+        PVE::Storage::Common::qemu_img_resize($path, $format, $size, undef, 10);
     }
 
     return 1;
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-07-22 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22 15:31 Fiona Ebner [this message]
2025-07-23 11:25 ` DERUMIER, Alexandre via pve-devel
2025-07-23 12:15 ` DERUMIER, Alexandre via pve-devel
2025-07-23 13:07   ` Fiona Ebner
2025-07-24  9:41 ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250722153231.107955-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal