Tool to get most cpu flags on common CPUs in a cluster?

CRCinAU

Renowned Member
May 4, 2020
209
66
68
crc.id.au
I was messing around today with the CPU types that I'm telling QEMU to use.

My home lab is a couple of repurposed Ryzen CPUs:

1 x AMD Ryzen 7 3700X 8-Core Processor (1 Socket)
1 x AMD Ryzen 7 5700G with Radeon Graphics (1 Socket)

I've been looking at the CPU flags available across both CPUs to get the maximum I can out of this install - while still having compatible CPU types to enable live migration.

I threw in the `flags` line in /proc/cpuinfo on both systems into Claude, and it suggested the `EPYC-Rome` CPU type for guests. Turns out the 3700X doesn't have the `xsaves` flag, so it gave me a suggestion of using the following in `/etc/pve/virtual-guest/cpu-models.conf`:

Code:
cpu-model: ryzen-cluster-cpu
    reported-model EPYC-Rome
    flags -xsaves
    phys-bits host
    hidden 0

This gives all the features that are common between these CPU types - which also has AES-NI - which `x86-64-v3` doesn't seem to include.

As this seems to be a pretty useful feature to give a 'best case' CPU to the guests, is there a way to do this in PVE without having to go via claude? ie a way to define a 'best capabilities' CPU type for common use between cluster nodes?
 
Hi,

since Proxmox VE 9.2, the web interface features mangemement of custom CPU models, under Datacenter -> Custom CPU models.

It allows quick filtering and shows which features are supported per node, so creating a custom CPU model based on that should be only be a bit more than a few clicks.

Hope that helps!
 
Ah, I didn't see that at all.

That being said, I'm struggling to get my head around how it would actually function. I can see how to represent the information I already have - but I'm not sure how I would discover how to create this if I hadn't already used Claude to give me a custom definition.

ie, if I filter based on the 3700X cpu, I don't see the xsaves option - as that CPU doesn't support it - but the 5700G does support it. I can only see xsaves by looking at the CPU flags for the 5700G - where its still set as 'default'.

This seems very counter-productive and very easy to miss things. Even knowing what I was looking for was difficult to achieve.

I wonder if a wizard to add a new CPU definition could be a thing where you can select the nodes you want to make the feature group from, and it picks the closest preset with any custom requirements - such as me using EYPC-Rome - xsaves.

If there's very different CPUs in the cluster, I would expect the common CPU feature set might be greatly reduced - hence the target node selection path for working this out.
 
Hey, thanks for your feedback!

I wonder if a wizard to add a new CPU definition could be a thing where you can select the nodes you want to make the feature group from, and it picks the closest preset with any custom requirements - such as me using EYPC-Rome - xsaves.
I did discuss something along those lines internally before with @fiona. The fully-automatic generation is likely a bit too much magic, and there is a fundamental problem in that kernel/microcode updates can change the exposed CPU feature set, which could break migration for running VMs.

What might be more realistic and still helpful is an overview of which CPU models are compatible with which nodes, and surfacing that in the migration preconditions. That would give the information to define the models you need yourself without the system guessing.

If you want, feel free to open a Bugzilla entry [0], this request would get more visibility there than on a forum post.

[0] https://bugzilla.proxmox.com/enter_bug.cgi?product=pve
 
  • Like
Reactions: fiona