Table of Contents

Overview

KVM is a virtualization hypervisor for linux

qcow2 vs raw disk

As of November, 2012 and on ubuntu 12.04 disk I/O was actually better with a qcow2 image that had preallocate=metadata option done to it. Raw disk I/O was slightly lower. As cache has been disabled in both instances it's unclear why this is the case when all information online points to a raw disk image would be better.

Converting qcow2 and raw images

Convert qcow2 to raw

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/srv/kvm/vm1/disk0.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/mapper/vg0-kvm_vm1'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

Convert raw to qcow2

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/mapper/vg0-kvm_vm1'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/srv/kvm/vm1/disk0.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

References