vCPU pinning is tedious... had Claude build a TUI for vCPU pinning + NUMA binding. Any suggestions?

Hi all,

I’m a research associate and got handed the job of managing our faculty’s shared experiment server (a two-socket KVM host with a rotating set of GPU-passthrough VMs for whoever needs compute that day). VMs come and go, so I end up repinning constantly, and hand-editing <cputune> / <numatune> XML while trying to remember which threads are already taken got old fast. So I vibed a terminal UI for it (xylophoneengine/pindergarten on github):

What it does

  • Scans host CPU/NUMA topology from sysfs and every libvirt domain’s config, shows which threads and memory nodes each VM is bound to
  • Pin / unpin / set memory node, staged as a reviewable queue, applied in one batch
  • Config-only changes via virDomainDefineXML – takes effect on next VM boot, never touches a running VM’s live scheduling
  • XML backup written before every write, with a diff view against the current domain
  • Drift check before apply, so a change made outside the tool doesn’t get clobbered
  • Starts read-only; edit mode is an explicit unlock
  • Single Go binary, works over SSH, mouse + keyboard

Full disclosure: this is vibecoded

The bulk of the code was written with Claude, because I need to focus on my actual job (which isn’t IT administration, but somebody has to do it…). I steered, reviewed, and tested it on that server and on my private workstation (the screenshot above). It works for me, but it has not been properly battle-tested beyond those two hosts. MIT licensed (is this the proper one to choose? I was considering GPLv3 or something, but a friend told me MIT is good).

Why I’m posting

It’s a tool I needed, and maybe you need it too. So …if a battle-proven tool for this already exists, please point me at it! I couldn’t really find one. Is anything obviously missing for your workflow? Not trying to sell anything, just want to know whether it’s worth polishing past “works for me.” Hope you’re all doing great, have a nice one! :slight_smile:

5 Likes

11/10 for naming, my approach to 64 core proxmox node numa affinity settings has been to just delegate it all to turnstone with a prompt like:

“Log into my proxmox host, use epyc 7713 best practices and current VM hardware utilization to optimize my workload cpu affinity and pin the stuff where you think it should go. Make no mistakes!”

The clankers do a great job of managing hardware and keeping it up to date as workloads change lol

1 Like

thanks for the headsup! What makes turnstone special? Or “just” your harness of choice? Have only tried claude cli and a bit of opencode up until now. Still kinda overwhelmed with both tbh

Very uneducated opinion: with AI and Linux BPF now can do crazy schedulers from user space I suspect writing a good scheduler for handling virtualization tasks might be better than cpu pinning.

  1. the rando who wrote it lurks in the forums.
  2. its web based.
  3. it does SSO with oauth and entra
  4. you can have multiple users sharing one workstream/session
  5. MCP and model providers with on behalf of oauth flows

you could certainly deploy whatever harness u like, but its just a convenient little lab manager for me to centrally steer the fleet of trash burning power in my basement.

Funny, I’m building pretty much the same thing.
Then I got sidetracked making a proxmox unattended iso builder which create a proxmox installation with thin root in a ramdrive but I’ll finish this eventually ! Also you’ll need a lot more than cpu pinning, the IRQs need to be managed, and I suggest you get good ways to automatically measure latency/stutter/jitter in your host and guests

Here is my repo about this

image

oops, you will have to reconstitute the github address yourself

proxmoxhelpers/host-inventory-for-proxmox

Ah, btw

to run it, you can do all of it with

./recommend_desktop_stack.sh

It’s been a couple days

But basically the point is to analyze host, VM config and then the guest and get the recommendation for every aspect

It collects extensive config data into .json files

then it gives you pretty interactive html pages like this

This is a really practical use case for a TUI. I especially like the staged changes, XML backups, diff view, and drift check since those features make automated configuration changes much safer. I am interested in seeing IRQ affinity and latency/jitter monitoring added too, since CPU pinning alone may not capture the whole performance picture for GPU-passthrough workloads.