Comparison of raw, cow, qcow, and qcow2 Images

Source: Internet
Author: User

I recently studied the image format of virtual machines and wrote a note to record these things.

In linux, there are many ways to choose virtual machines, such as vmware for linux, virtual box, And qemu. In the past, there were not many people using qemu, mainly because it was a little troublesome to use, however, with the rise of Openstack, qemu has also been greatly developed. Currently, the performance of qemu + kvm in Fedora is still very good. It would be even better if spice is added. But today I will talk about several image formats used in qemu!

1. raw

The raw format is the simplest and has nothing. Therefore, it is called the raw format. Even the header file does not exist, it is a file that is directly read and written to the virtual machine. Raw does not support dynamic space growth. You must specify the space size from the beginning. Therefore, disk space is greatly consumed. However, this aspect is not prominent in file systems that support sparse files (such as ext4. Objects Created by default in ext4 are sparse objects, so do not perform any additional work. Use

Du-sh file name

You can view the actual file size. That is to say, no matter how large the disk space is, there is no problem in running the following commands:

qemu-img create -f raw test.img 10000G

Raw image format is one of the best I/O performance formats for virtual machines. You can refer to raw when using raw. The better the performance, the closer it is to raw. However, raw does not have any other functions. For the emergence of sparse files, images such as qcow that allocate space during runtime have no advantages.

2. cow

The cow format is as simple as raw, and all space is allocated during creation. However, the cow has a bitmap table that records which sectors are currently used, so cow can use Incremental Images, that is to say, you can take an external snapshot of it. But cow does not have other functions, and its features are simple.

3. qcow

Qcow adds the function of dynamically increasing the file size based on cow, and supports encryption and compression. Qcow manages the space allocation of the entire image through a two-level index table. The second-level index uses the memory cache technology and requires search actions, which leads to performance loss. Currently, qcow is basically not used. On the one hand, its optimization and functions are not as good as qcow2, and on the other hand, its Read and Write performance is not as good as cow and raw.

4. qcow2

Qcow2 is a super image format integrating various technologies. It supports a series of functions such as internal snapshots, encryption, and compression, and the access performance is continuously improved. However, the problem with qcow2 is that it is too bloated to integrate all functions.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.