Problem:
I need to specify “host model” in the KVM Guest XML file for VM Guests running Centos Stream 8 and up. When Provisioning via Foreman - the CPU Mode is not specified in the XML file that is being generated. I looked at the libvirt.rb file on the foreman that generates the XML file and noticed that there is a stanza that looks like you can configure this but I am unsure how to modify the .rb file to build the new VM’s with this function.
What can/should I add to this file to specify “host model” as the VM CPU mode so I can ensure seamless installation of Centos Stream 8/9 guests via the Foreman and Katello?
Yes. Currently the Foreman Generated XML Files do not specify the CPU Mode - consequently this results in a kernel panic when I try to provision anything newer than CentOS 7.
Notice the Lines I have block-quoted in the Manually provisioned XML. This is what I need to have added to the libvirt guests that are provisioned via Katello.
I noticed there is a function in the libvirt.rb file that appears to be just what I need, however, I am unsure how to leverage this
# 'custom' is not implemented. This needs extra UI.
CPU_MODES = %w(default host-model host-passthrough)