r/openstack • u/myridan86 • May 04 '25
CPU (host-passthrough)
After several tests and researches, I came here to ask for help :)
I'm trying to configure a flavor to use host-passthrough (so that KVM ensures that the instance has all the host's CPU details).
My host (hypervisor) has this functionality, since with oVirt, it works, so I believe it's some error on my part in the nova-compute configuration.
I'm using Kolla-Ansible, and what I've already done is:
I created the file /etc/kolla/config/nova/nova-compute.conf
[libvirt]
virt_type = kvm
cpu_mode = none
kolla-ansible reconfigure --tags novaAfter the nova_compute container restarted:
docker exec -it nova_compute cat /etc/nova/nova.confThe updated information is in the file, so the reconfigure worked.
I created the flavor with the following commands:
openstack flavor create m1.host-passthrough --vcpus 4 --ram 4096 --disk 1 --id 7
openstack flavor set m1.host-passthrough --property hw:cpu_mode=host-passthroughRunning virsh dump, the xml is as follows:
<cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>qemu64</model>
<vendor>Intel</vendor>I tried with and without the cpu_mode = none parameter and the result was the same.
I don't know what I'm forgetting...
3
u/f0okyou May 04 '25
hw:cpu_mode doesn't exist so it has no effect.
https://docs.openstack.org/nova/latest/configuration/extra-specs.html#hw
You'll have to set the mode in nova.conf globally.
2
u/przemekkuczynski May 04 '25
First. You should configure it via kolla-ansible variable in globals
# Valid options are [ kvm, qemu, vmware ]
nova_compute_virt_type: "kvm"
nova_libvirt_cpu_mode
I configured on one node /etc/kolla/nova-compute/nova.conf
virt_type = kvm
cpu_mode = host-passthrough
docker restart nova_libvirt and nova_compute
Shutdown VM and start and I can see
<cpu mode='host-passthrough' check='none' migratable='on'>
1
u/myridan86 May 07 '25
Sorry for my insistence on this topic... I'm even looking for some training to help me.
But to summarize my question, is it possible to have "host-passthrough" instances and "traditional" instances on the same physical host or is this a "global configuration" for the host?
I believe this is a question that many people have, but they don't ask it, perhaps because it's a very beginner's question.