Skip to content
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

Enable KVM nesting #2553

Closed
fabiand opened this issue Feb 15, 2018 · 11 comments
Closed

Enable KVM nesting #2553

fabiand opened this issue Feb 15, 2018 · 11 comments

Comments

@fabiand
Copy link
Contributor

fabiand commented Feb 15, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Unsure

Please provide the following details:

Environment: Fedora 26

Minikube version: v0.25.0

  • OS (e.g. from /etc/os-release):
  • VM Driver: kvm2
  • ISO version: minikube-v0.25.1.iso
  • Install tools:
  • Others:

What happened: need /dev/kvm inside minikube

What you expected to happen: /dev/kvm is not inside

How to reproduce it (as minimally and precisely as possible): launch minikube look for /dev/kvm (have netsing on the host enabled

Output of minikube logs (if applicable):

Anything else do we need to know: According to docker-machine-kvm#36 nesting should be at least supported by docker machine.

@fabiand
Copy link
Contributor Author

fabiand commented Feb 15, 2018

Relevant for kubevirt/kubevirt#736

@gbraad
Copy link
Contributor

gbraad commented Feb 15, 2018

@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

@zakame but we could enable netsing (using the <cpu> tag as docker machine) in

const domainTmpl = `

@zakame
Copy link
Contributor

zakame commented Feb 16, 2018

fabiand added a commit to fabiand/minikube that referenced this issue Feb 16, 2018
Before this patch the virtual CPU was the stock qemu CPU, in the sense that
the virtual CPU features were set according to the default qemu CPU.
With this change the CPU features of the host will be copied at start to the
domain definition. This includes features like svm and vmx, which in turn allow
to run nested virtualization if the host is configured accordingly i.e.
`kvm_intel nested=y` in `/etc/modprobe.d/kvm.conf`.

Resolves #kubernetes#2553

Signed-off-by: Fabian Deutsch <[email protected]>
@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

@zakame that patch is adding it unconditionally - this should be safe, but for more compatibility we could make it configurable.

@zakame
Copy link
Contributor

zakame commented Feb 16, 2018

@fabiand yep, saw your pull too. Definitely something that can be configurable (e.g an --kvm-enable-host-passthrough flag or similar) 👍

@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

I've settled with --kvm-cpu-model (aligns nicer). Let me know what you think.

@zakame
Copy link
Contributor

zakame commented Feb 16, 2018

Yes that seems nicer and shorter too. Would that take an option (like e.g. --kvm-cpu-model=host-passthrough?)

@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

Exactly. Or host-model which is a little more compatible and might be useful in future in the ctx of the multinode work.

Only thing is that oyu need more "domain" knowledge in order to understand what to choose.

@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

I'm actually still struggling a bit to complete my testing, so stay tuned for some news.

fabiand added a commit to fabiand/minikube that referenced this issue Feb 16, 2018
Before this patch the virtual CPU was the stock qemu CPU, in the sense that
the virtual CPU features were set according to the default qemu CPU.

With this change the CPU features of the host will be copied at start to the
domain definition. This includes features like svm and vmx, which in turn allow
to run nested virtualization if the host is configured accordingly i.e.
`kvm_intel nested=y` in `/etc/modprobe.d/kvm.conf`.

To turn on nesting, a user has to specify `--kvm-cpu-model host-model` when
creating the VM.

Resolves kubernetes#2553

Signed-off-by: Fabian Deutsch <[email protected]>
@fabiand
Copy link
Contributor Author

fabiand commented Feb 16, 2018

The associated PR #2555 will enable nesting, reviews are highly appreciated.

fabiand added a commit to fabiand/minikube that referenced this issue Feb 21, 2018
With passthrough mode we can enable KVM nesting for guests.

Fixes kubernetes#2553

Signed-off-by: Fabian Deutsch <[email protected]>
dlorenc pushed a commit that referenced this issue Feb 22, 2018
Before this patch the virtual CPU was the stock qemu CPU, in the sense that
the virtual CPU features were set according to the default qemu CPU.

With this change the CPU features of the host will be copied at start to the
domain definition. This includes features like svm and vmx, which in turn allow
to run nested virtualization if the host is configured accordingly i.e.
`kvm_intel nested=y` in `/etc/modprobe.d/kvm.conf`.

To turn on nesting, a user has to specify `--kvm-cpu-model host-model` when
creating the VM.

Resolves #2553

Signed-off-by: Fabian Deutsch <[email protected]>
dlorenc pushed a commit that referenced this issue Feb 22, 2018
With passthrough mode we can enable KVM nesting for guests.

Fixes #2553

Signed-off-by: Fabian Deutsch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants