Changing the default CPU capabilities of KVM VM deployments

Hi,

When deploying a KVM VM, the CPU capabilities are very limited and set to QEMU/KVM CPU. I’d like to use host-passthrough as a default but I’m not sure where to find how MAAS communicates with Virsh or any config files.

Appreciate the help!

@ryan1336, you can connect to libvirtd or the Virtual Machine Manager to change the defaults or the values. have you tried that? also, you can use virsh-edit from the command line to change some virsh parameters.

maybe you can give some more details?

I’m not very familiar with libvirtd.

If MAAS is not responsible for the CPU options when creating domains, where abouts in libvirtd can I modify so that when MAAS deploys a new KVM virtual machine, it will have the correct options.

Not sure what you mean by “CPU options” – which ones?

@ryan1336: see if this post helps: https://ubuntu.com/blog/quick-add-kvms-for-maas

I’d like the virtual machines that MAAS creates to have host-passthrough as the CPU arch instead of the current CPU arch which is very basic.

For example, creating a VM with MAAS will produce a virtual machine that can’t even run Docker because the VCPU doesn’t have SSE4 capabilities.

  <cpu mode='host-passthrough' check='none'/>

I’d like to be automatically inserted into each new domain that is created by MAAS

@ryan1336, i see. this might actually be a bug; we have that on architectures other than x86_64. can you file a bug and we’ll look into it?

https://bugs.launchpad.net/maas/+filebug

Just to confirm, we’re not talking about the CPU architecture as in x86_64 but the feature flags and processor name/details retrieved from /proc/cpuinfo. I’d like them to have the host flags and details as via host-passthrough.

You’re saying that MAAS should be creating VMs with host-passthrough CPU flags and that it’s a bug that it isn’t?

Hello,

Still looking for an update on this.

@ryan1336, I’ve filed a bug on your behalf. I’ll let you know as it progresses through the system.

https://bugs.launchpad.net/maas/+bug/1876365

I’m having an issue caused by what OP is requesting here.

Don’t know the reason but when a machine gets created it asks for SVM flag which belongs to AMD not Intel causing this message at the KVM host.

qemu-system-x86_64: warning: host doesn’t support requested feature: CPUID.80000001H:ECX.svm

I had to edit the VM so it uses ‘minimum’ mode at CPU key instead of ‘exact’ which was the one used.