Running juju openstack_bundle.
the virt_type is set as qemu in nova-compute config.
```bash
$ juju config nova-compute virt-type
qemu
```
while trying to create instance, instance fails with error
libvirt.libvirtError: unsupported configuration: Emulator '/usr/bin/qemu-system-x86_64' does not support virt type 'kvm'
Manually add virt_type=qemu to libvirt section of nova.conf, restart nova-compute-service, instance creates successfully.
I didn't find anywhere in charm code that it add virt_type to nova.conf
Ubuntu version: "20.04.6 LTS (Focal Fossa)"
OpenStack Version: 'yoga/stable'
Juju version: 2.9.22-ubuntu-amd64
Full trace for nova error:
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [req-6cf6deda-a42a-4ea6-9f13-35c733baa365 25e4df64ce5f4b19a6783cbfff0f3f94 a7d9c8e0b2a64ddba41edffbf60b8802 - bb0b3b5430104b0ca59f0a1a8742f721 bb0b3b5430104b0ca59f0a1a8742f721] [in
stance: 3fc48db5-747a-4c64-8def-5af426160bc7] Instance failed to spawn: libvirt.libvirtError: unsupported configuration: Emulator '/usr/bin/qemu-system-x86_64' does not support virt type 'kvm'
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] Traceback (most recent call last):
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/compute/manager.py", line 2678, in _build_resources
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] yield resources
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/compute/manager.py", line 2438, in _build_and_run_instance
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] self.driver.spawn(context, instance, image_meta,
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/driver.py", line 3695, in spawn
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] self._create_domain_and_network(
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/driver.py", line 6635, in _create_domain_and_network
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] self._cleanup_failed_start(
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] self.force_reraise()
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] six.reraise(self.type_, self.value, self.tb)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] raise value
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/driver.py", line 6605, in _create_domain_and_network
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] guest = self._create_domain(
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/driver.py", line 6536, in _create_domain
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] guest = libvirt_guest.Guest.create(xml, self._host)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/guest.py", line 126, in create
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] LOG.error('Error defining a guest with XML: %s',
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] self.force_reraise()
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] six.reraise(self.type_, self.value, self.tb)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] raise value
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/guest.py", line 123, in create
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] guest = host.write_instance_config(xml)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/nova/virt/libvirt/host.py", line 1134, in write_instance_config
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] domain = self.get_connection().defineXML(xml)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 193, in doit
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] result = proxy_call(self._autowrap, f, *args, **kwargs)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 151, in proxy_call
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] rv = execute(f, *args, **kwargs)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 132, in execute
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] six.reraise(c, e, tb)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] raise value
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/eventlet/tpool.py", line 86, in tworker
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] rv = meth(*args, **kwargs)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] File "/usr/lib/python3/dist-packages/libvirt.py", line 4047, in defineXML
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] libvirt.libvirtError: unsupported configuration: Emulator '/usr/bin/qemu-system-x86_64' does not support virt type 'kvm'
2023-12-06 14:54:54.358 427185 ERROR nova.compute.manager [instance: 3fc48db5-747a-4c64-8def-5af426160bc7]
2023-12-06 14:54:54.360 427185 INFO nova.compute.manager [req-6cf6deda-a42a-4ea6-9f13-35c733baa365 25e4df64ce5f4b19a6783cbfff0f3f94 a7d9c8e0b2a64ddba41edffbf60b8802 - bb0b3b5430104b0ca59f0a1a8742f721 bb0b3b5430104b0ca59f0a1a8742f721] [instance: 3fc48db5-747a-4c64-8def-5af426160bc7] Terminating instance
I don't think this is a bug. The config for the charm states:
---
virt-type | string
Default: kvm
Virtualisation flavor. The only supported flavor is kvm.
Other native libvirt flavors available for testing only: uml, lxc, qemu.
NOTE: Changing the virtualisation flavor post-deployment is not
supported.
---
i.e. the charm (although it has the option!) doesn't actually support qemu as a version. although it ought to work for testing, which sadly it clearly doesn't. I'm setting to low as 'technically' it isn't a bug. Patches welcome if it's a priority for you, although yoga is now a few versions ago, so it's quite a bit of backporting though the stable branches.