Dan Kenigsberg has submitted this change and it was merged.
Change subject: image: use qemu-img convert to copy internal volumes
......................................................................
image: use qemu-img convert to copy internal volumes
According to the qemu-img manual:
You can use the backing_file option to force the output image to be
created as a copy on write image of the specified base image; the
backing_file should have the same content as the input's base image,
however the path, image format, etc may differ.
The benefits to use qemu-img convert instead of dd to copy the internal
volumes are:
- we unify operations under just one tool that is specific for image
manipulations
- copying images from block domains we won't copy the entire chunk
(1Gb) but only the amount of data really in use
- qemu-img when copying images tries to re-sparsify them, so on certain
occasion the destination image will be shrinked to a smaller size
The downside is the additional call to getParentVolume (that seems
trascurable compared to the amount of data that we're going to copy).
The following statistics were gathered using:
coreutils-8.4-37.el6.x86_64
kernel-2.6.32-504.1.3.el6.x86_64
qemu-img-rhev-0.12.1.2-2.415.el6_5.3.x86_64
each copy ran 5 times; the reported values are the average and the
standard deviation:
- dd 3Gb data volume on block domain: 67.16s +-2.19s [1]
- qemu-img 2Gb data volume on block domain: 37.60s +-0.32s
- dd 2Gb data volume on file domain: 79.02s +-7.44s
- qemu-img 2Gb data volume on file domain: 56.92s +-12.37s
All the volumes contained the same (u)random data which is the
worst case: qemu-img is forced to transfer each cluster of the image
as dd does (in all the other cases qemu-img transfers less data).
The only case where the amount of data transfered is different is
explicitly mentioned.
[1] here dd pays the price of having to copy the entire chunk of
allocated space (3Gb vs 2Gb of real data). Anyway even when
normalized to the same amount of data it's still slower.
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1156115
Change-Id: I1c740d88d52ca678d6c02d0ea500d2459c26560c
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on:
http://gerrit.ovirt.org/33355
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/storage/image.py
1 file changed, 20 insertions(+), 14 deletions(-)
Approvals:
Nir Soffer: Looks good to me, but someone else must approve
Federico Simoncelli: Verified
Dan Kenigsberg: Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/33355
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1c740d88d52ca678d6c02d0ea500d2459c26560c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server