Red Hat Bugzilla – Bug 611558
RFE: Disk I/O: control disk I/O priority via cgroups blkio controller
Last modified: 2016-03-20 20:15:58 EDT
This is missing feature of libvirt. Vmware is able to set priority. libvirt does not :(
The 'nice' and 'ionice' tunables aren't useful in a KVM scenario because they apply to individual $PIDs. KVM has separate thread per vCPU, plus many background threads. So it is necessary to apply the tunables to the entire process, not just individual PIDs.
For 'nice' equivalent, libvirt already supports the cgroups 'cpu' controller which exposes a 'cpu_shares' tunable. This lets you set relative priorities between VMs. eg VM A has cpu_shares of 512 and VM B has 1024, then VM B will be given twice the CPU running time of A.
For 'ionice', libvirt will need to integrate with cgroups again, this time the 'blkio' controller which lets disk IO be limited. This is a future work item
By the way, ionice still seems relevant to libvirt backends like qemu,
even with cgroups. cgroups does not seem to expose the same knob as
used for ionice classification. Nor does it seem to apply to buffered
i/o (such as likely would be the case for the libvirt 'writeback' i/o model).
Libvirt has supported blkiotune commands and XML for a while now, so I think this is fixed. If anyone wants to address the question about 'ionice' I suggest filing a new bug