[libvirt-users] Hard limit for the cpu usage of a VM

Wen Congyang wency at cn.fujitsu.com
Tue Nov 1 01:56:35 UTC 2011


At 10/25/2011 05:13 AM, Eric Blake Write:
> On 10/24/2011 02:54 PM, sethuraman subbiah wrote:
> 
>> [root at sbc11 ssubbiah]# virsh schedinfo rubis_ws --set vcpu_quota=50
>> Scheduler      : posix
>> error: invalid scheduler option: vcpu_quota=50
>>
>> I get the same error for "virsh schedinfo rubies_ws --set vcpu_quota
>> 50" .
>>
>> I find that my version is 0.9.4.
>>
>> [root at sbc11 ssubbiah]# virsh --version
>> 0.9.4
>>
>> Should I do some modifications,enable options or add some patch to get
>> the capability to set cap ? Thanks for all your help.
> 
> I found this comment in the code:
> 
>     /* If we does not know VCPU<->PID mapping or all vcpu runs in the same
>      * thread, we cannot control each vcpu. So we only modify cpu bandwidth
>      * when each vcpu has a separated thread.
>     
> I think that means that in order to use CPU caps, you have to also use
> <vcpupin> to call out the host CPU pinning to be used by the guest VCPUS.

VCPU<->PID mapping is the thread id for each vcpu. qemu-kvm supports this
feature. We use monitor command query-cpus to get VCPU<->PID mapping in
libvirt(the function is: qemuProcessDetectVcpuPIDs()).

> 
> The original implementation was here, although I don't see much
> documentation in that patch series.
> https://www.redhat.com/archives/libvir-list/2011-July/msg01389.html
> 
> Wen, can you help out here?
> 

It seems that the kernel does not support it. The cfs bandwidth was merged into
kernel tree about some months ago.

Thanks
Wen Congyang




More information about the libvirt-users mailing list