public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 qemu-server] fix #3324: clone disk: use larger blocksize for EFI disk
@ 2021-03-01 12:02 Fabian Ebner
  2021-03-01 13:00 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-03-01 12:02 UTC (permalink / raw)
  To: pve-devel

Moving to Ceph is very slow when bs=1. Instead, use a larger block size in
combination with the (currently) PVE-specific osize option to specify the
desired output size.

Suggested-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Thanks to Dietmar for pointing me in the right direction.

We actually have the exact feature I wished for (see patch #11 in pve-qemu).
I missed it the first time around, because it is not described in the man page,
only the keyword is stated in the short synopsis.

Changes from v1:
    * use osize option to control the output file size

 PVE/QemuServer.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f401baf..a498444 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6991,7 +6991,11 @@ sub clone_disk {
 		# that is given by the OVMF_VARS.fd
 		my $src_path = PVE::Storage::path($storecfg, $drive->{file});
 		my $dst_path = PVE::Storage::path($storecfg, $newvolid);
-		run_command(['qemu-img', 'dd', '-n', '-O', $dst_format, "bs=1", "count=$size",
+
+		# better for Ceph if block size is not too small, see bug #3324
+		my $bs = 1024*1024;
+
+		run_command(['qemu-img', 'dd', '-n', '-O', $dst_format, "bs=$bs", "osize=$size",
 		    "if=$src_path", "of=$dst_path"]);
 	    } else {
 		qemu_img_convert($drive->{file}, $newvolid, $size, $snapname, $sparseinit);
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-01 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 12:02 [pve-devel] [PATCH v2 qemu-server] fix #3324: clone disk: use larger blocksize for EFI disk Fabian Ebner
2021-03-01 13:00 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal