We are using qemu with kvm acceleration. I wanted to understand the -drive flag, currently we are using it as follows:

-drive file=<qcow2 snapshot file> if=virtio

I have the following questions

  1. Clarification - I understand that this uses 'file' as a drive image, which means that any writes happening within the QEMU execution will be written to this qcow2 file (which is essentially acting as the filesystem)

  2. Does qemu load the entire contents of this file in memory? Or is this on-demand like any other process? We would like to improve performance and hence see if we can force load the entire contents of the file in memory?

  3. We are currently using qcow2 image snapshots to load and start a QEMU instance. Is it possible to convert qcow2 to raw image (which is faster) and have the smallest of qcow2 as the overlay? How would that work? Essentially I want the capability to kill and restart QEMU images from the same state, but have the best possible performance (similar to .raw)

  • Best thing you can do is use SSDs. Nothing else you've suggested will buy you as much performance gain. – Michael Hampton Jul 10 '18 at 14:21
  • We are already using SSDs... can you comment on the clarifications and questions? – tsar2512 Jul 10 '18 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.