SaumonNet / proxmox-nixos

The Proxmox Hypervisor, on NixOS [maintainers=@camillemndn @julienmalka]
GNU Affero General Public License v3.0
644 stars 30 forks source link

Plans for declarative VM/LXC's? #36

Closed V3ntus closed 2 months ago

V3ntus commented 4 months ago

I quite like this project's ambitions! I'm curious, will there be plans for declarative VM or LXC deployment in the future? Sort of like microvm.nix [1]?

kieeps commented 4 months ago

Can we talk about this? :D

I love the idea of a fully declarative hypervisor... but how would that work? setting up a VM in a declarative way and have it show up in proxmox sounds doable, but what happens to the Data inside the VM/LXC when you revert to an earlier generation? will the virtual drive still reside on the system?

I guess configs such as /etc/pve/lxc/xxx.conf would be a nice addition to the nixos config :) but managing rootfs/virtual disks declarative sounds scary AF :D

I might be wrong tho, i'm fairly new to NixOS :)

V3ntus commented 4 months ago

Valid concerns for sure. Current NixOS VM variant configurations will produce a result that is essentially a pre-built qemu command impurely referencing a .qcow image in the working directory. Not a very "nix" way to do it, but I'm sure it can be improved on.

kieeps commented 4 months ago

Makes sense tho :-)

Maby not the "nixiest" way, as you said, but I dont see a better solution to the problem 😁

My only worry is the .qcow file itself.

As long as switching generation/rebuilding a miss-configured config doesn't result in deleting the .qcow 🙂

Although it could be possible to configure said VM/LXC in a declarative way, from the host, as long as the guest also runs NixOS 🙂

Just to clarify, I don't doubt that any of this is doable, I'm just curious how it all will get implemented 🙂

slavachertanovo commented 4 months ago

declarative VMs are already here, it's microvm declarative LXCs are also exists, it's called NixOS containers. It's possible to install NixOS on Proxmox QCOW image directly, then run it on Proxmox, but what's the reason? Proxmox shines when it's about other distros, BSD, Windows and other non-declarative OSes. It's just different approaches, you can use both on the same host.

JulienMalka commented 2 months ago

We did some work towards more declarative VMs in #59