Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
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

Closed

Description

@dlespiau

From the mailing-list:

> >   - 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

Activity

  1. dlespiau commented on May 23, 2017

    @dlespiau
    ContributorAuthor

    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.

  2. dlespiau commented on May 23, 2017

    @dlespiau
    ContributorAuthor

    Given how the other options are named, we should try to be consistent:

    unconstrained_max_vcpus = 4
    unconstrained_max_memory = 512MB 
    

    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.

  3. wuzhy commented on May 27, 2017

    @wuzhy

    OK, i will try to take this development fo this feature

  4. sboeuf commented on May 27, 2017

    @sboeuf

    @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.

  5. egernst commented on May 30, 2017

    @egernst

    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

  6. dlespiau commented on May 30, 2017

    @dlespiau
    ContributorAuthor

    Why do you need the number of slots? intel/cc-oci-runtime#805 doesn't seem to give a reason for that one.

  7. egernst commented on May 30, 2017

    @egernst

    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).

  8. sboeuf commented on May 31, 2017

    @sboeuf

    @wuzhy @egernst Is one of you working on this one ?

    The idea to get this one working is first to extend some Resources here: https://github.com/containers/virtcontainers/blob/master/pod.go#L236-L243

    Then 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 modify qemu.go in order to apply the configuration to Qemu: https://github.com/containers/virtcontainers/blob/master/qemu.go#L446-L462

    Enjoy !

  9. wuzhy commented on Jun 6, 2017

    @wuzhy

    @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

  10. sboeuf commented on Jun 8, 2017

    @sboeuf

    @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.

  11. added 6 commits that reference this issue on Jul 4, 2017
    5d17888
    6172684
    a7555c4
    cfa329b
    9eb5477
    5682afc
  12. egernst commented on Jul 17, 2017

    @egernst

    PR 198 closed -- latest is being handled on PR #297

  13. added 3 commits that reference this issue on Jul 18, 2017
    fe1563e
    5fd86b4
    d14ce99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions