New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Max hotplugged memory should not exceed actual max host memory #4516
Comments
I didn't label this issue as a "bug" but perhaps it should be since these high memory limit pods work with runc. |
This is an interesting feature. |
@skaegi, thinking out loud here, what's the behaviour on that? I'm afraid hot-plugging all the memory we have (even if less than requested) wouldn't actually fly as it could lead to resources starvation. Let's consider we use the suggested That's indeed an interesting bug to solve. |
I definitely do not want a pod being prevented from starting because of a Kata is hot-plugging the memory space and not reserving it -- e.g. we are already and very much on purpose running over-committed which is how Kubernetes is always run so this is not a resource starvation concern. If a user is very conservative and wants to minimize the chance of the oom-killer from coming into play as the host runs low on memory they can make sure the resource 'request' is equal to the 'limit'. We do that today in some testing circumstances and it works well. Off the top of my head the behavior I think makes the most sense is...
This is identical to the cpu hotplugging so not novel. In either case we should not prevent the pod from starting for a |
I'm onboard for providing tests for this feature and if you think it's simple I could try coding it too with some guidance. |
I will cook up something for that no later than next week. |
Let's add a `default_maxmemory` configuration, which allows the admins to set the maximum amount of memory to be used by a VM, considering the initial amount + whatever ends up being hotplugged via the pod limits. By default this value is 0 (zero), and it means that the whole physical RAM is the limit. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's add a `default_maxmemory` configuration, which allows the admins to set the maximum amount of memory to be used by a VM, considering the initial amount + whatever ends up being hotplugged via the pod limits. By default this value is 0 (zero), and it means that the whole physical RAM is the limit. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's add a `default_maxmemory` configuration, which allows the admins to set the maximum amount of memory to be used by a VM, considering the initial amount + whatever ends up being hotplugged via the pod limits. By default this value is 0 (zero), and it means that the whole physical RAM is the limit. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Let's adapt Cloud Hypervisor's and QEMU's code to properly behave to the newly added `default_maxmemory` config. While implementing this, a change of behaviour (or a bug fix, depending on how you see it) has been introduced as if a pod requests more memory than the amount avaiable in the host, instead of failing to start the pod, we simply hotplug the maximum amount of memory available, mimicing better the runc behaviour. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Expose the newly added `default_maxmemory` to the project's Makefile and to the configuration files. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
How would you set 'maxmemory' in your case @skaegi? I'm wondering how you'd manage this in a cluster that has a max of nodes configurations. |
@egernst I'm using this to create a set of runtime classes with pre-configured sizes like 1(cpu)x4(GB memory), 2x8, 4x16, etc. Each runtime class in turn is using different base micro-vm configs with resource sizes where the default and max cpu/memory are set to the same value. We've found our users are just terrible at setting individual resource requirements but are decent at giving a box size. Net result is the bin packing is definitely not as good, but the user experience is simpler and I have something much easier to use as a charging basis. |
Let's add a `default_maxmemory` configuration, which allows the admins to set the maximum amount of memory to be used by a VM, considering the initial amount + whatever ends up being hotplugged via the pod limits. By default this value is 0 (zero), and it means that the whole physical RAM is the limit. Fixes: kata-containers#4516 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
We're running into a problem when memory "limits" are used in our Kubernetes pods that work with runc but fail when run with Kata. Kata will look at the memory "limit" and try to hotplug the sum of all container memory limits into the guest. This works fine except if the memory exceeds the actual host's max memory in which case we get an error like this...
--
Here's an example Pod to illustrate (this Pod works in standard runc) ...
The above Pod is contrived however we are hitting this problem in our hosted solution.
For CPU limits the hotplugged vcpus do not exceed the hosts. Can we have the same support for memory so that we do not try to hotplug more memory than what the host has.
Less critical, but it would be great if this support could be generalized to supporting something like
default_maxmemory
analagous to the currentdefault_maxvcpus
support in our runtime-configuration.The text was updated successfully, but these errors were encountered: