Closed free2k closed 3 years ago
/cc @jcvenegas @devimc
@free2k thanks for raising this, your test case fails because by default kata containers run with 1 vcpu (cpu0) and you're trying to bind it to cpu1, if you want to bind your workload to a specific cpu make sure that the POD (Virtual Machine) has at least n+1 vcpus, for example
docker run --runtime kata-runtime --cpus 2 --cpuset-cpus="1" -it busybox /bin/sh
@devimc Thank you for your answer,There is another problem, I didn't understand it.
docker run --runtime kata-runtime --cpus 8 --memory 16G -it daocloud.io/library/centos /bin/sh
sh-4.2# lscpu CPU(s): 9 On-line CPU(s) list: 0-8
I assigned 8 cpus, actually I saw 9 cpus in the virtual machine. But docker's runc is showing 8 cpu
@free2k can we close the issue or you see any other problem ? you see one additional because one is let for the VM itself so you see one additional all the time. If you dont request any you only will see one cpu.
@free2k actually I found an issue where this is a problematic error. The cpusets fails here because they dont exist on the VM but, the we should expect that those are applied on the host and may be dont fail or do a map on the guest.
So this is a limitation today in kata that we need to document.
@jcvenegas I think you fixed this error, can we close it?
Is --cpuset-cpus supportted in kata? now I really confused. when I specify --cpus and --cpuset-cpus at the same time just as below, the result is that container has 2 cpus, not 1 or 4, in this case, it should be 4, correct? BTW, I don't mind the online CPUs is not corresponded with cpuset-cpus at this moment.
root@k8s:~# docker run --rm --runtime kata-runtime --cpus 1 --cpuset-cpus 0-3 -ti be2868bebaba bash root@1b9f7cbc6c85:/# lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 61 Model name: Intel Core Processor (Broadwell, IBRS) Stepping: 2 CPU MHz: 2599.988 BogoMIPS: 5199.97 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 4096K L3 cache: 16384K Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f rdseed adx smap avx512cd xsaveopt arat
root@k8s:~# kata-runtime version
kata-runtime : 1.10.0-alpha1
commit : <
@middlestone take a look to this document https://github.com/kata-containers/documentation/blob/master/design/vcpu-handling.md
regarding --cpuset-cpus 0-3
argument, it can't be honoured in the guest (VM) because there are not enough vcpus (4)
@devimc thanks for your quick reply, I undertand what happen now.
Description of problem
docker run --runtime kata-runtime --cpuset-cpus="0" -it busybox /bin/sh
If bound to 0 core, it can run normally without any error.2.
docker run --runtime kata-runtime --cpuset-cpus="1" -it busybox /bin/sh
If you bind to a non-zero core, then he will report an error./usr/bin/docker-current: 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:279: applying cgroup configuration for process caused \"failed to write 1 to cpuset.cpus: write /sys/fs/cgroup/cpuset/system.slice:docker:f3ee1e8406433c46bae3b450c63e5117e2a72ccecc57a1776781031a24eaf916/cpuset.cpus: invalid argument\"".
Expected result
No matter which core is bound to it, it should run correctly.
Actual result
Binding error
`# Meta details
Running
kata-collect-data.sh
version1.3.0 (commit a786643)
at2019-01-07.14:44:21.206714732+0800
.Runtime is
/bin/kata-runtime
.kata-env
Output of "
/bin/kata-runtime kata-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/kata-containers/configuration.toml
not found Output of "cat "/usr/share/defaults/kata-containers/configuration.toml"
":KSM throttler
version
Output of "
--version
":systemd service
Image details
Initrd details
No initrd
Logfiles
Runtime logs
Recent runtime problems found in system journal:
Proxy logs
Recent proxy problems found in system journal:
Shim logs
No recent shim problems found in system journal.
Throttler logs
No recent throttler problems found in system journal.
Container manager details
Have
docker
Docker
Output of "
docker version
":Output of "
docker info
":Output of "
systemctl show docker
":No
kubectl
Packages
No
dpkg
Haverpm
Output of "rpm -qa|egrep "(cc-oci-runtimecc-runtimerunv|kata-proxy|kata-runtime|kata-shim|kata-ksm-throttler|kata-containers-image|linux-container|qemu-)"
":---`