andsens / bootstrap-vz

Bootstrap Debian images for virtualized environments
http://bootstrap-vz.readthedocs.io/
Other
263 stars 145 forks source link

Compress QCOW2 when shrinking #453

Closed drts01 closed 6 years ago

drts01 commented 6 years ago

Seems like one would want a compressed QCOW2 image if the volume is being shrunk.

drts01 commented 6 years ago

Yup, that definitely should be clarified. I added some comments, will that suffice?

andsens commented 6 years ago

Plenty sufficient :-)
Merged.

mengelmann commented 6 years ago

I know it's merged already, but shouldn't the compression be configurable? There is a performance impact each time when reading from a compressed qcow2 image.

andsens commented 6 years ago

I was unaware. @CMeza99?

drts01 commented 6 years ago

There is definitely a use case to not compress. I just addressed this in PR #453. Is that a satisfactory solution/approach?

compression (under the right circumstances) will reduce the size of the data stored on disk at the expense of CPU to compress (one off) and decompress (every time the data is accessed) the data. In certain circumstances, compression can result in a quicker read for the process consuming the data, such as where CPU is abundant and IO bandwidth is very small.

-- https://www.jamescoyle.net/how-to/1810-qcow2-disk-images-and-performance