On a CentOS 7 host, I'm creating a VM from an Amazon Linux 2 qcow2 image:
- Download Amazon Linux 2 cloud-init image (.qcow2 format)
- Copy this file, run
qemu-img resize
to expand it to 40G - Define it in my VM using
<disk type='file'>
and<source file='my_resized_file.qcow2'>
This works - but I'm running ~30 VMs on this host, all running quite heavy Docker workloads - and the disk IO isn't good enough.
I want to try using iothreads
, cache=none
and io=native
as a number of posts online indicate improved performance for SSDs and high-CPU count hosts with these settings. I have plenty of CPU to spare.
I've tried simply adding iothreads=1
to the domain and iothread=1
to the disk, but this fails with the error IOThreads not supported for this QEMU
. I presume this is because I'm using disk type=file
rather than disk type=block
.
I would like to:
- Use the OS image, and its cloud-init functions
- Have 40G available to the VM
- Use raw file type,
iothreads
,cache=none
andio=native
for maximum performance
My question is therefore...
How do I get my qcow2 OS image to become a 40G raw block device that I can use with these parameters?