]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #3324: clone disk: use larger blocksize for EFI disk
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 1 Mar 2021 12:02:23 +0000 (13:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 1 Mar 2021 12:58:34 +0000 (13:58 +0100)
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>
PVE/QemuServer.pm

index f401baffc5e5e9a26b783aa997669b514d03a064..a498444b13f45bc6f849883f10746948e74ce1bd 100644 (file)
@@ -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);