Closed yuntongjin closed 3 years ago
The root cause is that exceed the maximum amount of memory virtcontainers/qemu.go if currentMemory+memDev.sizeMB > int(maxMem) { // Fixme: return a typed error return 0, fmt.Errorf("Unable to hotplug %d MiB memory, the SB has %d MiB and the maximum amount is %d MiB", memDev.sizeMB, currentMemory, q.config.MemorySize) }
From kata-collect-data.sh systemctl show docker: MemoryCurrent=18446744073709551615 MemoryLimit= 18446744073 709551615
The MemoryCurrent doesn't sound right.
your host memory size is 2048M?
the SB has 116736 MiB, the host memory should over 116 GB
Please run "cat /proc/meminfo" and post the result in your host.
/cc @jcvenegas - we had something like this recently where the host memory was big enough, but I think that fix got merged. I think we don't allow over-commit - and I suspect most host systems are by default configured to not allow it either.
@jcvenegas PTAL as this is some code you've been looking into recently.
@yuntongjin see a couple of issues here.
The first message you get was an issue fixed recently in master msg="Unable to hotplug 16384 MiB memory, the SB has 116736 MiB and the maximum amount is 2048
the amount reported was wrong
, I will backport it to 1.4.x.
Also I see, no free slots available I wonder if in your test you previously hotplug memory in the container. I ask because seems that no free slots available
reflects the real issue, to avoid increase the amount of memory footprint this is limited to 10 slots of memory to hotplug. You can increase it in the kata configuration file MemorySlots =
@grahamwhaley do you have the issue # and commit to fix this issue?
@jcvenegas the code commit a5a74f6d20f9c6c7cecee6209263b1b867b81244 fix the error message, is there commit to fix the logic currentMemory+memDev.sizeMB > int(maxMem)? meanwhile we are testing to workaround this issue by increasing MemorySlots =
@yuntongjin - I think that fix was just to fix the message, as it was misleading. In that case iirc, the user was trying to allocate more memory than their machine physically had. It will be good to see if the memoryslots helps/fixes/changes this.
Description of problem
Set default_memory = 16384
Kata runtime failed to create: runtime log: msg="Unable to hotplug 16384 MiB memory, the SB has 116736 MiB and the maximum amount is 2048 MiB" arch=amd64 command=create container=
msg="{\"error\": {\"class\": \"GenericError\", \"desc\": \"no free slots available\"}}" arch=amd64 command=create container
(replace this text with the list of steps you followed)
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)
(replace this text with the output of the
kata-collect-data.sh
script, after you have reviewed its content to ensure it does not contain any private information).Meta details
Running
kata-collect-data.sh
version1.4.0 (commit 21f0059)
at2019-01-14.14:32:37.443546011+0800
.Runtime is
/usr/bin/kata-runtime
.kata-env
Output of "
/usr/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 "
/usr/lib64/kata-ksm-throttler/kata-ksm-throttler --version
":Output of "
/usr/lib/systemd/system/kata-ksm-throttler.service --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
":Have
kubectl
Kubernetes
Output of "
kubectl version
":Output of "
kubectl config view
":Output of "
systemctl show kubelet
":No
crio
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-)"
":