astro / microvm.nix

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

Set microvm hostname as process name in runner #198

Closed c0deaddict closed 9 months ago

c0deaddict commented 9 months ago

Having multiple microvm's running on my server it's always hard to see in top which VM is taking up resources: all processes are named cloud-hypervisor. This patch renames the process /nix/store/$hash-cloud-hypervisor (or whatever hypervisor is used) to microvm-$hostname making it possible to distinguish the running VM's. I'm not sure if other people also find this desirable, if not, maybe this can be added behing a toggle flag?

PS. it only shows the microvm name in top if the full command line is shown (eg. pressing c).

astro commented 9 months ago

I like this a lot. Thank you!

I guess adding a default-on option to opt out of it should make everyone happy.

By the way: would microvm@$name be a valid process title? Because that matches the systemd service.