[libvirt-users] Libvirt LXC vcpu doesn't seem to work

Michal Privoznik mprivozn at redhat.com
Thu Aug 13 08:07:46 UTC 2015


On 12.08.2015 18:26, Dave Riches wrote:
> Hi,
> 
> I seem to have a problem when creating a LXC container through virsh.
> 
> While virsh -c lxc:/// dominfo <container> shows up (for example) 2
> VCPUs as defined, if I run a CPU intensive task (such as stress --cpu
> 10) it will max out 10 CPU cores on the host.
> 
> If I echo "0" > /cgroup/cpuset/libvirt/lxc/<domain>/cpuset.cpus
> 
> then the container is properly confined to just one CPU core.
> Subsequently, running stress --cpu 10 only one core on the host is maxed
> out.
> 
> Does anyone know what syntax/config I'm missing, while installing the
> lxc container via virsh..to ensure that the VCPUs are restricted to the
> number defined?
> 
> Thanks in advance

Yeah, that has never worked. I guess you need to pin the vcpus and then
it might work. As your own example proves.

Michal




More information about the libvirt-users mailing list