Closed Ace-Tang closed 3 years ago
/cc @devimc.
I try docker, it also fails,
#docker run -d --runtime=kata-runtime reg.docker.alibaba-inc.com/ali/os:7u2
e2850cf332577e44ac10797d457b977b03d78f46a96b8b34e965374bd2e02f67
[root@t100081180009.et15sqa /home/huamin.thm]
#docker run -d -m 5g --runtime=kata-runtime reg.docker.alibaba-inc.com/ali/os:7u2
50935d902dda4b083fb306efc708db1b7b1512e7b91bdf22b9feff53bed2f85a
docker: Error response from daemon: oci runtime error: rpc error: code = Internal desc = Could not run process: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"process_linux.go:367: setting cgroup config for procHooks process caused \\\"failed to write 10737418240 to memory.memsw.limit_in_bytes: open /sys/fs/cgroup/memory/docker/50935d902dda4b083fb306efc708db1b7b1512e7b91bdf22b9feff53bed2f85a/memory.memsw.limit_in_bytes: permission denied\\\"\"".
seems set cgroup also do in vm, thats why it fails.
@Ace-Tang sorry I don't have access to reg.docker.alibaba-inc.com/ali/os:7u2
with debian works for me
$ docker run -d -m 5g --runtime=kata-runtime debian bash
e5ffaa122cf9424366d570c06850ed113b120d5443bf8045c69a89bfbdd21229
@devimc, does this related guest image. I am not use the image created by the latest osbuilder
@Ace-Tang mmm ok, I guess you are using a custom kernel,
@devimc , yes, I use 4.9.69-006-3005309+
guest kernel with some custom, but most is base on upstream.
failed to write 10737418240 to memory.memsw.limit_in_bytes
the log comes from kata-proxy, is proxy also set cgroup in vm? and it need kernel do something? I just guess.
@Ace-Tang seems like your kernel is not up-to-date
see https://github.com/kata-containers/packaging/pull/104 and https://github.com/kata-containers/packaging/blob/master/kernel/configs/x86_64_kata_kvm_4.14.x#L150-L172
@devimc I've had it in mind for some time that we should also support the cases that there is no cgroups support in the guest kernel (by adding a kata-runtime config option of course). Then users can choose not to restrict there containers with cgroups in the guest but just add proper limits on the host.
wdyt about it? cc @sboeuf @gnawux @egernst
Set memory fail because host not have memory.memsw.limit_in_bytes
, but set cpu also fail, I will check where the problem is
#pouch run -d --cpuset-cpus=1 --runtime=kata-runtime f0083c036ad3
Error: failed to run container 9019d1: {"message":"failed to create container(9019d17ee7bc4034af1b032e8edf0dbf756bec0e22f6f90f9757c96f60452f78) on containerd: failed to create task for container(9019d17ee7bc4034af1b032e8edf0dbf756bec0e22f6f90f9757c96f60452f78): OCI runtime create failed: rpc error: code = Internal desc = Could not run process: container_linux.go:348: starting container process caused \"process_linux.go:402: container init caused \\\"process_linux.go:367: setting cgroup config for procHooks process caused \\\\\\\"cannot set limits on the cpuset cgroup, as the container has not joined it\\\\\\\"\\\"\", 0\n, <nil>: unknown"}
I found that if specify --cpuset-cpus="0,1"
, but set default_vcpus = 1
in /etc/kata-containers/configuration.toml
, the container will fail to start, since qemu only get 1 cpu core, I just wonder if default_vcpus
less than count of cpuset, we can set default_vcpus=len(cpuset-cpus)
, @devimc @bergwolf .
Description of problem
Run container without flag can successful,
but if specify
memory=2g
or specify--cpuset-cpus="0"
, it will fail,I found the error come from
kata-agent
, and kata-agent version is1.3.0-rc0-e3eb9cec00671706e1e99f349d09995b1f382a33
.Expected result
(replace this text with an explanation of what you thought would happen)
Actual result
(replace this text with details of what actually happened)
logs: