This guide is for existing VM’s.
Backup VM config
virsh dumpxml <vmname> > ~/vmname.xml
Replace vmname
with Virtual Machine (Domain) name. You can find correct name by running virsh list --all
Image Conversion
Find path of existing image (in qcow2) format
virsh dumpxml <vmname> | grep file
Will show something like:
<disk type='file' device='disk'> <source file='/var/lib/libvirt/images/ubuntu-kvm/tmpjaAefX.qcow2'/>
Conversion
Sample command is:
qemu-img convert {image_name}.qcow2 {image_name}.raw
So in this case, it will be:
qemu-img convert /var/lib/libvirt/images/ubuntu-kvm/tmpjaAefX.qcow2 /var/lib/libvirt/images/ubuntu-kvm/tmpjaAefX.raw
At this point conversion is complete.
Edit VM Configuration
Edit VM Config
Run following command to open editor.
virsh edit <vmname>
Find lines like below:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/ubuntu-kvm/tmpU2z98r.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk>
Replaceqcow2
withraw
Ain 2 places highlighted above.
Your update config will look like below:
<disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/ubuntu-kvm/tmpU2z98r.raw'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk>
Save your changes and exit editor.
Start VM
Run following command:
virsh start <vmname>
At this point you can run your disk I/O benchmarks again to check speed.