[libvirt-users] How do you set real time bandwidth for a container?

Michal Privoznik mprivozn at redhat.com
Sun Oct 30 21:28:23 UTC 2016

On 29.10.2016 01:01, Peter Steele wrote:
> When I create a VM using libvirt, the VM comes up the path
> /sys/fs/cgroup/cpu/cpu.rt_runtime_us set to something like 1000000. When
> I create a container however, the path
> /sys/fs/cgroup/cpu/cpu.rt_runtime_us is 0. This prevents my containers
> from being able to run any real time applications. I have to explicitly
> echo a value into this field in order to give the container some real
> time bandwidth and allow it to run real time processes.

This is some weird kernel default. I mean libvirt does not set that
value anywhere.

> Is it possible to define this in a container's XML config? Or is there
> another method I should be using to enable real time capability in a
> container?

No, currently there's no way to provide that in XML config. However, you
can create a hook script that is executed whenever domain is being
started and that script can set the proper value for you.


More information about the libvirt-users mailing list