Runtime: Using Firecracker, setting default_vcpus doesn't work

Created on 4 Dec 2019  路  4Comments  路  Source: kata-containers/runtime

Description of problem

We are trying to set the amount of CPU cores for the Kata Firecracker "container". We couldn't find a working option for Docker (like --cpus="4"), so we started editing the _configuration-fc.toml_ file in _/opt/kata/shared/defaults/_ (the _configuraton.toml_ file was been symlinked to this file).

Edits:

default_vcpus = 4
default_maxvcpus = 0

Expected result

The _kata-fc_ runtime should set the CPU cores of new containers to 4, but it didn't.

Actual result

The output of cat /proc/cpuinfo:

[root@87139662b549 /]# cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 94
model name  : Intel(R) Xeon(R) Processor @ 2.10GHz
stepping    : 3
microcode   : 0x1
cpu MHz     : 2111.876
cache size  : 8192 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx 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 stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves arat umip md_clear arch_capabilities
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips    : 4223.75
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

[root@87139662b549 /

When we change the symlink of _configuration.toml_ to configuration-qemu.toml and insert default_vcpus = 4 and run a container using _kata-qemu_, the container does get 4 CPU's.

bug needs-review

All 4 comments

firecracker does not support cpu hotplug, I will take a look to see what we can do

@devimc CPU hotplug sounds to me like a feature you can use when the Firecracker VM is already running. Just to be sure that it's clear what I mean: I can't adjust how much cores by default Kata allocates to a new fc container.

fixed

Was this page helpful?
0 / 5 - 0 ratings