astro / microvm.nix

NixOS MicroVMs
https://astro.github.io/microvm.nix/
MIT License
1.26k stars 94 forks source link

CPU options for `cloud-hypervisor` #157

Open jpds opened 10 months ago

jpds commented 10 months ago

We need to expose a way for the user to add additional --cpus options at:

https://github.com/astro/microvm.nix/blob/dfe2d3db94e4829e317f97e3a095d6fd8b91f30c/lib/runners/cloud-hypervisor.nix#L96

I tried to figure out a nice way to do this with Nix, but had to end with hard-coding it to make a machine work.

astro commented 10 months ago

I was not even aware cloud-hypervisor had that many CPU options!

To make it accessible from NixOS configuration, these hypervisor-specific bits can be exposed in hypervisor-specific NixOS options just like we already do for QEMU with microvm.qemu.extraArgs. They don't have to be as generic as extraArgs.

If you're ready to walk an extra mile with this, know that this project abstracts away specifics to present you with unified configuration of different hypervisors. It would take some time to research what capabilities can be controlled through common options.