Capping VM IO with cgroups

cgroupkvm-virtualizationlibvirt

I'm using cgroups to cap disk IO that a VM does by using libvirt's support for cgroups.

So, I'm getting the major/minor number of the device from a 'ls -lL' on the drive where the '.img' file for the VM is located.

However, when I try to cap the IO, I get an error –
root@Silver:/sys/fs/cgroup/blkio/sysdefault/libvirt/qemu/debian1# echo "8:6 1048576" > blkio.throttle.read_bps_device
bash: echo: write error: No such device

Any idea what I'm doing wrong?

Best Answer

It looks like you might be mixing sysctl syntax and filesystem syntax for these options. Check what the actual path is to the sysfs file you are wanting to write to (is it /sys/fs/cgroup/blkio/sysdefault/libvirt/qemu/debian1/blkio/throttle/read_bps_device?).