While working in virtualized environments, we need to pass around virtual machines (a.k.a. virtual appliances) from time to time. Most of the virtual machines I’ve seen for downloading are compressed to save storage and network bandwidth.
Not all the compression algorithms are created equal in terms of compression ratio, compressing speed, and decompressing speed. In most cases, it doesn’t really matter that much with documents and small programs. But it matters a lot with virtual machines whose virtual disk files are much larger than normal files. Any small percentage improvement can result in significant saving on storage and bandwidth.
Bothered by SLOW Web UI to manage vSphere? Want to manage ALL your VMware vCenters, AWS, Azure, Openstack, container behind a SINGLE pane of glass? Want to search, analyze, report, visualize VMs, hosts, networks, datastores, events as easily as Google the Web? Find out more about vSearch 3.0: the search engine for all your private and public clouds.
I recently compared several compression algorithms with a virtual machine based on Linux which is the main OS type of virtual machine as should. The following table is what I found. Note that this does not mean to be a comprehensive comparison.
As the table shows, the 7Z has by far the best compression ratio for virtual machines with about 30% smaller size than others like Zip. This is actually consistent with the data with other types of files as shown in the 7Zip home page.
Given that the 7Zip is better and free (how can you beat that?), it should be the de facto tool for compressing all virtual appliances. Should you find better tools, please feel free to share.
It’s worthwhile to point out that 7Zip has not only a nice GUI, but also a command line interface which allows you to achieve same things as with GUI. This helps a lot for integrating it with your automatic release system.
7Zip has also been ported to Linux with command line only, which is good enough for most use cases like supporting Linux based build system. Check it out here. Update: IBM DeveloperWorks has an article How to use 7zip on Linux command Line.