Kubevirt: Serval enhancement to port macOS VM to kubevirt

Created on 29 Sep 2019  路  11Comments  路  Source: kubevirt/kubevirt

Is this a BUG REPORT or FEATURE REQUEST?:

/kind enhancement

What happened:

I want to create a macOS VM that runs and is managed by kubevirt (related issue #2312). I follow the guide on OSX-KVM.

But I found we miss some libvirt fields to define macOS VM with release-0.21 VirtualMachineInstanceSpec.

I handle this by adding serval OnDefineDomain hook-sidecars, finally my macOS libvirt-xml looks like https://gist.github.com/lxs137/cbebea860902f79ad198fa00038e0eff, I don't like this manual workaround, I would like to extend the VirtualMachineInstanceSpec:

  1. macOS VM need custom BootLoader and NVRam, cur version just use a fixed path EFI, I want to import EFI from a custom Volume: https://github.com/kubevirt/kubevirt/blob/e220f16d7a2aae7295199bbbc3594a5b50b7a3f4/pkg/virt-launcher/virtwrap/api/converter.go#L680-L693

  2. macOS VM cannot detect raw format disk.img, but cur version just fix the driverType to raw, I want to custom disk driverType: https://github.com/kubevirt/kubevirt/blob/e220f16d7a2aae7295199bbbc3594a5b50b7a3f4/pkg/virt-launcher/virtwrap/api/converter.go#L312-L317

  3. macOS VM can only detect e1000-82545em or vmxnet3 nic model, but cur version cannot support, I want to add more supported nic model:
    https://github.com/kubevirt/kubevirt/blob/e220f16d7a2aae7295199bbbc3594a5b50b7a3f4/pkg/virt-api/webhooks/validating-webhook/admitters/vmi-create-admitter.go#L62

  4. macOS cannot support PS/2 input device, only USB input device can work, but cur version just support tablet input device, I want to define keyboard USB input device:
    https://github.com/kubevirt/kubevirt/blob/e220f16d7a2aae7295199bbbc3594a5b50b7a3f4/staging/src/kubevirt.io/client-go/api/v1/schema.go#L348-L357
    Also I find implied libvirt USB controller not work, I must explicit define USB controller in my libvirt xml (Probably implied USB controller works on some macOS version, I am not sure):

<controller type='usb' index='0' model='piix3-uhci'/>

I am not familiar with qemu and libvirt, maybe some changes is not required to port macOS to kubevirt, please give me some advise.

And I am glad to do some PR on these enhancement. :) THX

kinenhancement lifecyclrotten

Most helpful comment

@lxs137 Would you mind sharing your resource file for getting either OSX-KVM or macOS-Simple-KVM running on Kubevirt?

All 11 comments

Take a look at this https://github.com/foxlet/macOS-Simple-KVM

Seems like it might be possible to integrate the steps required for that to work in KubeVirt.

Take a look at this https://github.com/foxlet/macOS-Simple-KVM

Seems like it might be possible to integrate the steps required for that to work in KubeVirt.

Yes, macOS can work in kubevirt now in my situation. But it need some dirty work, such as miscellaneous hook sidecars and an extended MutationWebhook.

@fabiand What do you think about these four features? I have no idea how to impl feature-1, is it suitable to load EFI data from volumes?

I could imagine that we could support pointing to a different EFI loader by using an annotation, just like it's done in Kubernetes for alpha/try-out features.

I.e. you'd add an annotation to the VM/VMI definition to specify the loader to use. Which could i.e. reside on a PV/C or containerDisk

But I am just one voice.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@kubevirt-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lxs137 Would you mind sharing your resource file for getting either OSX-KVM or macOS-Simple-KVM running on Kubevirt?

@lucatk @lxs137 any chance you could share instructions on how to do this?

@lucatk @lxs137 any chance you could share instructions on how to do this?

@lucatk @tlawrie Sorry for my late reply.

I have a README about this: https://github.com/droidvirt/kubevirt-sidecars/blob/master/osx-hook-sidecar/README.md

It needs MutatingWebhook and kubevirt-hook-sidecar.

I think it's just a workaround, it will be better if the kubevirt can add some feature to support this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vatsalparekh picture vatsalparekh  路  11Comments

stu-gott picture stu-gott  路  3Comments

booxter picture booxter  路  6Comments

fabiand picture fabiand  路  12Comments

gageorsburn picture gageorsburn  路  10Comments