[lxc-users] Number of core for a container

support at translators.at support at translators.at
Fri Nov 10 13:08:47 UTC 2017



	hi Thouraya,

Am 2017-11-10 um 13:29 schrieb Thouraya TH:
> Please, is there a command to display containers and list of cores used by
> each container ?
	as far as I know: nope.

	meanwhile
	what you can do is to put container's names
	in a csv-file or grep it by »lxc list«-command
	and let a shell-script iterate
	over for displaying by

	lxc config show $container | grep limits.cpu

	what you must have set up before by
	lxc config set $container limits.cpu number (i.e. 2)

	otherwise you won't be able to see any number
	of used cpus that way.

	if you haven't already set limits.cpu you can do
	instead an interation (see above) over your containers by
	
	lxc exec $container -- cat /proc/cpuinfo | grep processor


> A second question please,  can i fix that only container 1 uses  cpu
> 2,3 *(exclusive use)* or not ? i.e container 2 CANNOT use cpu 2,3
	don't think so. makes no sense.

	regards
	karl


More information about the lxc-users mailing list