fix #3324: clone disk: use larger blocksize for EFI disk

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>
This commit is contained in:
Fabian Ebner 2021-03-01 13:02:23 +01:00 committed by Thomas Lamprecht
parent 483c9676f8
commit fdfdc80ece

View File

@ -6991,7 +6991,11 @@ sub clone_disk {
# that is given by the OVMF_VARS.fd # that is given by the OVMF_VARS.fd
my $src_path = PVE::Storage::path($storecfg, $drive->{file}); my $src_path = PVE::Storage::path($storecfg, $drive->{file});
my $dst_path = PVE::Storage::path($storecfg, $newvolid); 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"]); "if=$src_path", "of=$dst_path"]);
} else { } else {
qemu_img_convert($drive->{file}, $newvolid, $size, $snapname, $sparseinit); qemu_img_convert($drive->{file}, $newvolid, $size, $snapname, $sparseinit);