Error creating VM's on RHEL 7 Hypervisor

Problem:

Unable to create VM’s on RHEL/Centos 7 hypervisor after upgrade to 3.9.1. Getting the following error:

internal error: process exited while connecting to monitor: qemu-kvm: -machine q35,accel=kvm,usb=off,dump-guest-core=off: Unsupported machine type
Use -machine help to list supported machines!

I previously upgraded to 3.9.1 to be able to provision Libvirt VM’s to a RHEL 8 hypervisor - and now am unable to write to RHEL 7.

Expected outcome:
VM’s being provisioned

Foreman and Proxy versions:

3.9.1

Foreman and Proxy plugin versions:

Distribution and version:

RHEL 8

Other relevant data:

@ekohl Do we pass the machine type from the Foreman or is it something coming from the Libvirt?

We set the machine type to q35 since this commit:

I didn’t realize it would break EL 7 hypervisors, but it’s needed for EL 9 where the default machine type (pc) doesn’t work anymore. I wonder if a proper implementation would look at the supported machine types and picks q35 if it’s in there instead.