How to modify kvm command line arguments

How should I go about changing command line arguments to KVM? Things like cache=none or cache=writethrough.

I noticed that the swap uses cache=off : shouldn't it be cache=none (Ubuntu 12.04)?

Also how can I set cache=none or cache=writeback for the main LV which is mounted as root on the VM.

And yes I know cache=writeback may not be a good idea, but my KVMs have such slow IO Performance (only about 1/3 of the host) that I am desperate for some improvement.

The host is a quad core i7 with 32GB memory and software Raid-1 (2 x 3 TB) running Ubuntu 12.04. The VMs are also running Ubuntu 12.04.



My impression is that cache=none is only for use when the underlying disk file is a device or partition.

Cache=off is best for swap, because it makes no sense to cache swap in RAM on the host system when it is explicitly meant to use disk.

That said, you can edit these settings in Cloudmin as follows :

  1. Login to the master system via SSH as root.
  2. Run the command cloudmin list-systems --host xyz --id-only , where xyz is the full hostname of your VM.
  3. Edit the file under /etc/webmin/servers whose name starts with that ID.
  4. Find the line starting with kvm_drives and make whatever changes you want.

@Jamie: You are right and we are talking about the same thing.
I was trying to point out that option syntax on Ubuntu 12.04 according to the man pages is "cache=none" and there is no "cache=off" option.
So you may need to correct that in the next release for Debian / Ubuntu. There is also a bootup message about boot=on being deprecated that you may need to fix in the next release.

That's odd, as on my system the man page says the option is cache=off.

Which KVM version are you running there?

I started off with Cloudmin's Ubuntu 12.04 image and did an
apt-get update and apt-get upgrade

Current Version:
qemu-common 1.0+noroms-0ubuntu14.2
qemu-kvm 1.0+noroms-0ubuntu14.2
qemu-utils 1.0+noroms-0ubuntu14.2
kvm-ipxe 1.0.0+git-3.55f6c88-0ubuntu1

Exerpt from man kvm:

cache is "none", "writeback", "unsafe", "directsync" or
"writethrough" and controls how the host cache is used to
access block data.

Here is the excerpt from kvm --help:

-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]

I just upgraded to the latest versions of KVM.

Do you think
will make a difference for performance? One of the blogs was recommending that.

It looks like cache=off is still supported, and does the same thing as cache=none ... and some older versions of Qemu still require this. So I'm reluctant to change Cloudmin to use cache=none for now.

I'm not sure if aio=native will help, but you could try it out using the same method I suggested in comment #1.