Credit-Based CPU Scheduler

I am trying to ensure that one VM doesn’t take over all the CPU on a physical machine. Will there be Credit-Based CPU Scheduling in KVM like Xen?

I tried the following command but it is not supported by KVM (RHEL 5.5):
$ virsh schedinfo RHEL5u3-tomcat
Scheduler : Unknown
error: this function is not supported by the hypervisor: virDomainGetSchedulerType

If there is no current support, is there another way that I can accomplish this?

In order to accomplish your goal, you can use the IRMOS real-time scheduler for Linux.

With it, you can encapsulate an entire KVM process within a temporal reservation specifying two parameters: a budget Q and a period P, with the meaning that Q microseconds are granted to the Virtual Machine (VM) every P microseconds. More information is available here:

lwn.net/Articles/398470/
retis.sssup.it/~tommaso/eng/publ … ERT09-HMPR

The advantage of using this scheduler over the real-time throttling of the mainline kernel is that the configured reservation constitutes not only a limit, but also a guarantee for each VM, and that you can use completely different periods for different VMs.

Feel free to write should you need further info.