Setting default CPU type on virtual machines cluster wide

slacker

New Member
Sep 5, 2017
4
1
1
36
I've recently stood up a cluster of 3 identical systems running proxmox. I discovered that by default the CPU type is kvm64, which according to this
https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines
emulates a Pentium 4 sacrificing many instruction sets in modern processors. I am aware this is to avoid any pitfalls in migrating vm's between hosts, but we're potentially sacrificing performance to do so, and those of us that know our hardware could benefit from changing this default.

I realize I may now go back and modify every VM config file and change the cputype to host to take advantage of my processor and it's more modern instruction sets. I would like to request the option to change the default cputype cluster wide so that after creating the cluster all virtual machines will utilize that cputype specified, similar to how EVC is configured in VMware. Defaulting to kvm64 seems counter intuitive for an enterprise grade virtualization solution. In my experience, virtualization clusters are generally purchased all at once with the same CPU type, where the kvm64 cpu type would benefit those of us who assemble our clusters with whatever we can find.
 
  • Like
Reactions: mjw
I support this request. I am aware that templates can also be used to achieve this result but creating one in order to modify a single default (ie. cputype) seems overkill.

I see the defaults for vm specs are hardcoded in the source, would it be too much to read them from a file, a la datacenter.cfg style?
 
while i understand why you want this,

i think the effort needed for this is much bigger than the benefit

following scenarios are likely for creating a vm

1. vm is manually created via gui/cli/api
- in this case, you can simply set the appropriate cpu type, either in the combobox (takes about 5 s max i would say) or as an additional option on the cli/api

2. vm is automatically created
- in this case, you have to know on which cluster you create the vm anyway, so it should not be hard to have a mapping of cputypes <-> cluster and incorporate that

for existing clusters, there is all the power of the linux cli
example:

for i in $(qm list | awk '{if (NR>1) { print $1 }}'); do qm set $i -cpu "<TYPE>"; done

which sets the cpu type of all vms of this host to "<TYPE>"
(this can be expanded to a cluster and other parameters)

edit:
sorry i forgot to mention:

but please if you want that feature, open a feature request at https://bugzilla.proxmox.com where we can track this better