Packer: [builder/qemu] doc: disk_compression vs skip_compaction

Created on 6 Mar 2017  ยท  5Comments  ยท  Source: hashicorp/packer

In the QEMU builder documentation, there are currently 2 options to specify if you want your images to be compressed by Packer:

disk_compression (boolean) - Apply compression to the QCOW2 disk file using qemu-img convert. Defaults to false.

and

skip_compaction (boolean) - Packer compacts the QCOW2 image using qemu-img convert. Set this option to true to disable compacting. Defaults to false.

They look like the same to me.
Are there both used in the code or is one of them a legacy option ?
Should we drop one in favor of the other to improve the documentation quality ?

Thanks !

buildeqemu question

Most helpful comment

@Wenzel The other alternative is people Google for this since the documentation isn't clear and hit upon this issue (like what just happened in my case)

All 5 comments

No they are not the same. Compaction is moving all used blocks to a continues segment by copying the image. Compression is gzip the content.

additional info:
compaction detects zeros data inside qcow2 and discard it, so image is smaller.
compression - enable internal qcow2 compression, can slowdown running vm.

Hi !
thank you for these precisions regarding the options.

Would it be possible to add these details in the QEMU documentation ?
So that no one will be confused in the future about this (and open an issue) ? :)

Thanks !

@Wenzel The other alternative is people Google for this since the documentation isn't clear and hit upon this issue (like what just happened in my case)

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings