For example, run the following command to convert a QCOW2 image file to a ZVHD2 file: qemu-img-hw convert-p-O zvhd2 test.qcow2 test.zvhd2. Querying image file information: qemu-img-hw info Image file. An example command is qemu-img-hw info test.zvhd2. Viewing help information: qemu-img-hw –help.

QEMU disk image utility for Windows. It is used for converting, creating and consistency checking of various virtual disk formats. It’s compatible with Hyper-V, KVM, VMware, VirtualBox and Xen virtualization solutions.This build has been optimized for Windows Server (x64), including Windows Nano Server.

Usage examples

Convert a QCOW2, RAW, VMDK or VDI image to VHDX

Convert Qcow2 To Iso
qemu-img.exe convert source.img-Ovpc-osubformat=dynamic dest.vhd

Subformat can be either “dynamic” or “fixed” for VHD (vpc) or VHDX.

Note: use the fixed VHD subformat for Azure, the conversion will automatically take care of the required 1MB virtual size alignment.

Check a virtual disk for consistency

Convert Qcow2 To Iso Installer

Get info about a virtual disk

Convert

Run qemu-img.exe -h or see the manual page for a complete list of all supported options.

Supported formats

Image formatArgument for -f and -O options
VMDK (VMware)vmdk
QCOW2 (KVM, Xen)qcow2
VHD (Hyper-V)vpc
VHDX (Hyper-V)vhdx
RAWraw
VDI (VirtualBox)vdi

Links

Source code: https://github.com/cloudbase/qemu
QEMU’s project main page: http://www.qemu.org
Alternative QEMU binaries: http://qemu.weilnetz.de/
Documentation: http://qemu.weilnetz.de/qemu-doc.html#qemu_005fimg_005finvocation

Convert Qcow2 To Iso Reader

Skip to main content

KVM convert qcow2 disk images to raw disk images for performance

Published: 16-02-2014 | Author: Remy van Elst | Text only version of this article


Table of Contents

This tutorial shows you how to convert KVM qcow2 disk images to raw disk images.The qcow2 disk format has some decent features like encryption, compression andcopy to write support. However, the compression and the copy processes make itquite a bit slower than raw disk images. Sometimes you want to convert the diskimages so that the VM will perform better.

Benchmark

For me it has a performance boost. Using a RAID 1 setup with two 5900 RPM disksand the deadline on the host and the noop scheduler without caching on a rawimage in the guest resulted in a boost over the default deadline scheduler ona qcow2 image on the guest:

Test command:

Default Ubuntu 12.04 vmbuilder created vm on a qcow2 image without caching andwith the deadline scheduler in the VM:

The same VM, disk image converted to raw image without caching and using thenoop scheduler in the VM:

That's quite a performance boost. The KVM host has the following result with thedd command:

Converting the image

I'll convert the disk image for the example vm vm1. Change the name and diskpaths for your setup.

First shut down the VM:

Then convert all the disk images using this command for each disk image:

Convert Qcow To Qcow2

Edit the VM config:

Convert

Change the disk section to point to the new raw image:

Change the lines <driver name='qemu' type='qcow2'/> and <sourcefile='/var/lib/libvirt/images/vm1/ubuntu-kvm/tmp20ePgc.qcow2'/> to <drivername='qemu' type='raw'/> and <source file='/var/lib/libvirt/images/vm1/ubuntu-kvm/tmp20ePgc.raw'/>. Like so:

That's it. Start the VM:

If it all works, remove the qcow2 image:

Disk scheduler

To change the default disk scheduler in your VM, you can use the followingcommand:

To check the current scheduler:

Convert Qcow2 To Bootable Iso

Output:

Convert Qcow2 To Raw

Here the deadline scheduler is being used. To change it:

Now the noop scheduler is being used:

Convert Qcow2 To Iso Bootable

Remember to add this command to /etc/rc.local to make it survive a reboot. Onubuntu you can also define it in /etc/default/grub. ChangeGRUB_CMDLINE_LINUX_DEFAULT='quiet splash' toGRUB_CMDLINE_LINUX_DEFAULT='quiet splash elevator=noop' and run an update-grub2 to make it permanent

Tags: dd, deadline, disk, kvm, noop, performance, scheduler, tutorials, ubuntu, virsh, virtualization

Convert Qcow2 To Iso Usb