Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance importer to use qemu-img pseudo streaming to save /tmp step #254

Closed
jeffvance opened this issue Jul 12, 2018 · 0 comments
Closed
Assignees
Milestone

Comments

@jeffvance
Copy link
Contributor

For qcow2 files, rather than copying to /tmp/rand-name and then running qcow2-img to convert it to raw, we can use qcow2-img to copy the file and convert it, saving the intermediate step and saving disk/cpu on the host. Of course .tar.gz, .xz conversion needs to still be done first so this may only help for the simple case of importing .qcow2 --> raw.

Some timings from a recent email:

$ time wget http://local.server/Fedora-AtomicHost-28-20180625.1.x86_64.qcow2 
...
Length: 638043136 (608M) [application/octet-stream]Saving to: ‘Fedora-AtomicHost-28-20180625.1.x86_64.qcow2’

Fedora-AtomicHost-28-20180625.1.x86_64.qcow2    100%[=====================================================================================================>] 608.49M   107MB/s    in 5.6s    

2018-07-09 21:38:39 (108 MB/s) - ‘Fedora-AtomicHost-28-20180625.1.x86_64.qcow2’ saved [638043136/638043136]


real	0m5.941s
user	0m0.183s
sys	0m1.185s

$ time qemu-img convert -p -f qcow2 -O raw http://local.server/Fedora-AtomicHost-28-20180625.1.x86_64.qcow2 converted.raw
    (100.00/100%)

real	0m14.217s
user	0m5.235s
sys	0m2.343s

$ time qemu-img convert -p -f qcow2 -O raw Fedora-AtomicHost-28-20180625.1.x86_64.qcow2 converted.raw
    (100.00/100%)

real	0m11.909s
user	0m4.728s
sys	0m1.595s

So converting on the fly is even little faster then downloading to temporary file and converting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants