Skip to content
This repository was archived by the owner on Apr 3, 2018. It is now read-only.

qemu: honor DefaultVCPUs#662

Merged
sameo merged 1 commit intocontainers:masterfrom
devimc:cpu/honor_default_vcpus
Mar 7, 2018
Merged

qemu: honor DefaultVCPUs#662
sameo merged 1 commit intocontainers:masterfrom
devimc:cpu/honor_default_vcpus

Conversation

@devimc
Copy link
Copy Markdown
Collaborator

@devimc devimc commented Mar 6, 2018

Currently when a container with CPU constrains is created using docker,
the VM starts with a wrong number of vCPUs, the VM must start with the
number of vCPUs specified by default_vcpus allowing to the runtime hot
add/remove resources as needed.

For example if DefaultVCPUs (default_vcpus) is 1 and the container has
a constraint of 4 (docker run --cpus 4 ...), the VM must start with 1
vCPU because the runtime hot add 4 vCPUs.
Qemu command line example:
old:
qemu-system-x86_64 ... -smp 4,cores=1,threads=1,sockets=1,maxcpus=240

new:
qemu-system-x86_64 ... -smp 1,cores=1,threads=1,sockets=1,maxcpus=240

Depends-on: github.com/clearcontainers/runtime#1048

see clearcontainers/runtime#1032 and
clearcontainers/runtime#1041

fixes #661

Signed-off-by: Julio Montes julio.montes@intel.com

@grahamwhaley
Copy link
Copy Markdown
Contributor

DNM I presume this is WIP.
I see lots of deleted code :-)
It would be nice if we had some fragments of the qemu command line - the current bad one and the proposed new one - in the PR message, so we could see what was changing.

Currently when a container with CPU constrains is created using docker,
the VM starts with a wrong number of vCPUs, the VM must start with the
number of vCPUs specified by `default_vcpus` allowing to the runtime hot
add/remove resources as needed.

For example if DefaultVCPUs (default_vcpus) is 1 and the container has
a constraint of 4 (docker run --cpus 4 ...), the VM must start with 1
vCPU because the runtime hot add 4 vCPUs.
Qemu command line example:
old:
`qemu-system-x86_64 ... -smp 4,cores=1,threads=1,sockets=1,maxcpus=240`

new:
`qemu-system-x86_64 ... -smp 1,cores=1,threads=1,sockets=1,maxcpus=240`

Depends-on: github.com/clearcontainers/runtime#1048

see clearcontainers/runtime#1032 and
clearcontainers/runtime#1041

fixes containers#661

Signed-off-by: Julio Montes <julio.montes@intel.com>
@devimc devimc force-pushed the cpu/honor_default_vcpus branch from 1779d25 to c3ad9c2 Compare March 6, 2018 16:25
@devimc
Copy link
Copy Markdown
Collaborator Author

devimc commented Mar 6, 2018

@grahamwhaley changes applied, thanks

@sboeuf
Copy link
Copy Markdown
Collaborator

sboeuf commented Mar 6, 2018

Thanks @devimc, this is the follow up we need after your patch for hotplugging CPU was merged.
LGTM

@sameo
Copy link
Copy Markdown
Collaborator

sameo commented Mar 7, 2018

LGTM

Approved with PullApprove Approved with PullApprove

@sameo sameo merged commit 4fb2dac into containers:master Mar 7, 2018
@sameo sameo removed the review label Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start docker container with the right number of vCPUs

4 participants