Using qcow for your disk images

Posted on May 25, 2008. Filed under: QEMU, Software, XEN | Tags: , , |

For the uninitiated, CoW stands for Copy on Write. Suppose you have to make two copies of something, creating a full copy could be expensive. So, what you do is, when you do a copy, just share the contents. When you modify one of the copies, only then a copy – Copy on Write. So, as you expect, this saves space.

So, what is qcow ? It’s Qemu CoW. Qemu is a open source virtual machine manager. QCoW is a disk image format which consumes disk space only when contents are actually written on it. So, a blank 5G disk image just consumes a few kilobytes of data. Cool you’d say. Wait! there’s more to it. You can create new disk images by basing them on existing ones. When you do this, only the deltas will be written to your new disk file and the base image is treated as read only.

Now, how is this useful ? – when you create many virtual machines. Suppose you have to run 100 virtual machines (that’s not unreasonable), with each disk image occupying 10G disk space. SO you’d need 1TB of storage ? Not with qcow. With a little more than 10G you can create 100 disk images as told above.

You can create disk images using an utility called qemu-img. You can also convert between various formats, and create cow qcow images.

The best part is, today even XEN suports qcow. But there’s a difference between the formats used by qemu and XEN. They are incompatible, and this gave me endless troubles yesterday. I converted a raw disk image to qcow using a utility called img-qcow. Now to create a new qcow image for use with XEN and which is based on the original qcow, i used qcow-create. It usage is simple.

Folks, if you want to use qcow within XEN make sure you

  • Dont create qcow images using qemu-img
  • Dont convert qcow-images using qemu-img
  • Use only qcow-create and img2qcow utilities.
  • Dont expect these qcow images to work with QEMU, and even XEN HVM.

Doesn’t XEN simply suck ? They’ve borrowed the qcow disk format and even its driver from QEMU and they’ve made it incompatibe with its source! :(

About these ads

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

One Response to “Using qcow for your disk images”

RSS Feed for Brain Dump Comments RSS Feed

Did you use qcow or qcow2? Which version of Xen was used?

Where's The Comment Form?

  • Feed

  • Ohloh

  • Bookmarks

  • Categories

  • Visitors

  • Hits

    • 49,592 hits

Liked it here?
Why not try sites on the blogroll...


Get every new post delivered to your Inbox.

%d bloggers like this: