dhiltgen / docker-machine-kvm

KVM driver for docker-machine
Apache License 2.0
376 stars 111 forks source link

Allow setting the CPU model OR enabling nesting #36

Closed fabiand closed 6 years ago

fabiand commented 7 years ago

Sometimes - like with kubevirt we are running VMs with kubernetes. In that context we'd like to allow nesting, this requires libvirtd to use <cpu mode='host-model'> for the (minikube) VM.

It would be nice if there was a way to enable this.

zakame commented 7 years ago

For KVM nesting, I think docker-machine-kvm already passess in host-passthrough for the CPU (https://github.com/dhiltgen/docker-machine-kvm/blob/master/kvm.go#L40) so it would need only the host machine enabling nesting (e.g. option kvm_intel nested=y) in /etc/modprobe.d/kvm.conf.

fabiand commented 6 years ago

Hm. I am not sure why, but in minikube <cpu> is not used.

@gbraad any idea?

gbraad commented 6 years ago

KVM2 in minikube has diverged, so not sure why they dropped this. @aaron-prindle @r2d4 Any idea? But we are in the process to move this driver to a new home: #67 This might help for this situation...

zakame commented 6 years ago

Yes, The kvm2 driver doesn't provide options for CPUs other than setting the number to allocate to VM: https://github.com/kubernetes/minikube/blob/9fe915461445d340ec9272f3b043f75f42008ea5/pkg/drivers/kvm/kvm.go#L44

Currently it seems to do the bare minimum libvirt config only.

fabiand commented 6 years ago

Thanks @gbraad

Moving the minikube thread over to https://github.com/kubernetes/minikube/issues/2553 @zakame @gbraad

fabiand commented 6 years ago

Actually, on this issues - I think we can close it, because - yes - docker machine has passthrough set which should be neough if the host is configured acccordingly.