You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 6, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on May 6, 2020. It is now read-only.
Add config fields for max vCPUs and memory for uncontrained containers #164
> > - The second case is for unconstrained containers, the ones where the
> > user doesn't give explicit constraints like the above. I think it
> > could make sense for us to have a setting in the runtime config file
> > for the admin to override the max number of vCPUS and maxmem for
> > unconstrained containers.
> Yes, we should do that.
>
> Zhi, do you want to take that one ? virtcontainers already allows for
> setting a pod VCPUs and memory, so it would be a matter of extending the
> configuration structure to add e.g. a "VirtualMachine" section [1][2]
> and then modifying the podConfig appropriately [3]
>
> [1] https://github.com/clearcontainers/runtime/blob/master/config/configuration.toml
> [2] https://github.com/clearcontainers/runtime/blob/master/config.go
> [3] https://github.com/clearcontainers/runtime/blob/master/create.go#L83-L86
We should probably convey that this setting is for the unconstrained
case something like unconstrainedMaxVCPUs and unconstrainedMaxMemory.
It also sounds like it's really time to up our game with documentation and have a sysadmin view to explain this. I'll define and open more tentative tasks around documentation.
@wuzhy Yes that sounds good. Could you explain briefly the way you want to implement it before you submit a PR. I would like that we are on the same page so that you don't waste your time implementing a design that we don't agree with.
Currently, 2 is the correct amount (since we "hotplug" the nvdimm). I'm not sure of a scenario where we'll need to hotplug any more than this, but was just listing out the possible RAM parameters that are otherwise hardcoded (the other two are definitely needed).
@sboeuf sorry for late reply, Today i spent some time to develop this feature, just push it to my github, and submit a pull request, if you have time, can you help review? thanks. #198
Activity
dlespiau commentedon May 23, 2017
We should probably convey that this setting is for the unconstrained
case something like unconstrainedMaxVCPUs and unconstrainedMaxMemory.
It also sounds like it's really time to up our game with documentation and have a sysadmin view to explain this. I'll define and open more tentative tasks around documentation.
dlespiau commentedon May 23, 2017
Given how the other options are named, we should try to be consistent:
We'll need to be able to parse the various KB, MB, GB, ... suffixes for the memory parameter (with unit-tests).
For the section name, maybe we could use put those values in the [hypervisor.xxx] sections? there are hypervisor parameters after all.
wuzhy commentedon May 27, 2017
OK, i will try to take this development fo this feature
sboeuf commentedon May 27, 2017
@wuzhy Yes that sounds good. Could you explain briefly the way you want to implement it before you submit a PR. I would like that we are on the same page so that you don't waste your time implementing a design that we don't agree with.
egernst commentedon May 30, 2017
I want to make sure that parameters for memory also include:
-default amount of memory (memory at boot)
-maxmem
-number of memory slots
These are three parameters which ultimately need to be provided to QEMU which should be configurable. For example:
-m
2G,slots=2,maxmem=3G
should be:
-m
@VM_MEM@,slots=2,maxmem=@VM_MEM_MAX@
An equivalent 2.1 requirement with further details on why this is needed:
intel/cc-oci-runtime#805
dlespiau commentedon May 30, 2017
Why do you need the number of slots? intel/cc-oci-runtime#805 doesn't seem to give a reason for that one.
egernst commentedon May 30, 2017
Currently, 2 is the correct amount (since we "hotplug" the nvdimm). I'm not sure of a scenario where we'll need to hotplug any more than this, but was just listing out the possible RAM parameters that are otherwise hardcoded (the other two are definitely needed).
sboeuf commentedon May 31, 2017
@wuzhy @egernst Is one of you working on this one ?
The idea to get this one working is first to extend some
Resourceshere: https://github.com/containers/virtcontainers/blob/master/pod.go#L236-L243Then you can add some configuration fields in the config.go here: https://github.com/clearcontainers/runtime/blob/master/config.go#L80-L84, corresponding to the new fields you expect to be filled into the virtcontainers structure.
And finally you have to make the relation between the runtime and virtcontainers library, that is using the OCI package inside virtcontainers, filling every fields you need: https://github.com/containers/virtcontainers/blob/master/pkg/oci/utils.go#L217-L245
That's pretty basic and easy. But in case you are defining some new configurable fields (let's say
slots), you will also have to modifyqemu.goin order to apply the configuration to Qemu: https://github.com/containers/virtcontainers/blob/master/qemu.go#L446-L462Enjoy !
runtime: Make vCPUs and memory to be configurable for uncontrained co…
wuzhy commentedon Jun 6, 2017
@sboeuf sorry for late reply, Today i spent some time to develop this feature, just push it to my github, and submit a pull request, if you have time, can you help review? thanks.
#198
sboeuf commentedon Jun 8, 2017
@wuzhy That's great, thanks for your work. Please follow comments from @jodh-intel on #198 so that you comply with the expected way to implement this.
config: Add default_{vcpus, memory} configurations
config: Add default_{vcpus, memory} configurations
vendor: Update virtcontainers vendoring
config: Add default_{vcpus, memory} configurations
vendor: Update virtcontainers vendoring
config: Add default_{vcpus, memory} configurations
egernst commentedon Jul 17, 2017
PR 198 closed -- latest is being handled on PR #297
vendor: Update virtcontainers vendoring
config: Add default_{vcpus, memory} configurations
config: Add default_{vcpus, memory} configurations