From 19d6e8c1c9f8ef30a6c98ba73ad6d0613bdc1ad0 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Mon, 29 Jun 2026 10:55:46 +1000 Subject: Add opt-in SPICE support for Rocky via COPR. RHEL9 dropped SPICE support from qemu-kvm, and Rocky Linux followed suit. Up until now the documented guidance has been to use the Debian or Ubuntu container images if you want to serve the ``spice-direct`` console type, because the stock Rocky nova-libvirt image will simply fail to start any SPICE-enabled instance. This change adds a second version of the nova-libvirt container image called nova-libvirt-spice. It is always built, but is identical for all supported container base distributions except for Rocky Linux. In the Rocky Linux case, this container adds the community maintained ligenix/enterprise-qemu-spice COPR repository that provides a rebuild of ``qemu-kvm`` with SPICE support re-enabled for both EPEL 9 and EPEL 10. Which nova-libvirt container should be used in a given deployment is delegated to logic in kolla-ansible, based on the deployer's settings in globals.yml. The COPR is a third-party rebuild with no vendor support contract. The release note and support matrix are updated to describe the opt-in path and call this caveat out explicitly. The earlier "you must use Debian or Ubuntu" wording in the support matrix is softened here, rather than by retroactively editing the kerbside container-build patch that introduced it, so that this feature can land (or not land) independently of the earlier change. Partial-Bug: #2131793 (spice-direct consoles) Prompt: I am interested in seeing how we would go about using https://copr.fedorainfracloud.org/coprs/ligenix/enterprise-qemu-spice/ to add SPICE support back to the Kolla build Rocky Linux containers as a new patch in the kolla/ORDER list. Could you please investigate options here? Assisted-By: Claude Code Co-Authored-By: Claude Opus 4.7 (1M context, medium effort) Change-Id: I410b87b7f8cdd541c48d9a749b3fea634a5f4e6c Signed-off-by: Michael Still --- docker/nova/nova-libvirt-spice/Dockerfile.j2 | 117 +++++++++++++++++++++++++ docker/nova/nova-libvirt-spice/extend_start.sh | 11 +++ 2 files changed, 128 insertions(+) create mode 100644 docker/nova/nova-libvirt-spice/Dockerfile.j2 create mode 100644 docker/nova/nova-libvirt-spice/extend_start.sh (limited to 'docker/nova') diff --git a/docker/nova/nova-libvirt-spice/Dockerfile.j2 b/docker/nova/nova-libvirt-spice/Dockerfile.j2 new file mode 100644 index 000000000..dd090a1e6 --- /dev/null +++ b/docker/nova/nova-libvirt-spice/Dockerfile.j2 @@ -0,0 +1,117 @@ +FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} +{% block labels %} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +{% endblock %} + +{% block nova_libvirt_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{{ macros.configure_user(name='nova', groups='qemu') }} + +{% if base_package_type == 'rpm' %} + + {% set nova_libvirt_extra_repos = ['ceph', 'crb', 'epel', 'openvswitch'] %} + {% if base_distro == 'rocky' %} + {# + The stock Rocky qemu-kvm has SPICE compiled out. To enable + Kerbside and the nova ``spice-direct`` console we therefore + layer the ligenix COPR in so that qemu-kvm and spice-server + are available with SPICE re-enabled. The repo definition + lives in kolla/template/repos.yaml so deployers can override + it like any other extra repo. + #} + {% set nova_libvirt_extra_repos = nova_libvirt_extra_repos + ['ligenix-qemu-spice'] %} + {% endif %} + +{{ macros.enable_extra_repos(nova_libvirt_extra_repos) }} + + {% set nova_libvirt_packages = [ + 'ceph-common', + 'cyrus-sasl-md5', + 'cyrus-sasl-scram', + 'libguestfs', + 'libvirt-client', + 'libvirt-daemon', + 'libvirt-daemon-config-nwfilter', + 'libvirt-daemon-driver-nwfilter', + 'libvirt-daemon-driver-nodedev', + 'openvswitch${KOLLA_RPM_OVS_VERSION}', + 'qemu-img', + 'qemu-kvm', + 'swtpm', + ] %} + {% if base_arch == 'x86_64' %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'edk2-ovmf' + ] %} + {% elif base_arch == 'aarch64' %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'edk2-aarch64' + ] %} + {% endif %} + + {% if use_ligenix_qemu | default(false) and base_distro == 'rocky' %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'qemu-kvm-ui-spice', + 'spice-server', + ] %} + {% endif %} + +{% elif base_package_type == 'deb' %} + + {% set nova_libvirt_packages = [ + 'ceph-common', + 'ebtables', + 'libsasl2-modules-gssapi-mit', + 'libvirt-clients', + 'libvirt-daemon-system', + 'mdevctl', + 'openvswitch-switch', + 'pm-utils', + 'python3-cephfs', + 'python3-rados', + 'python3-rbd', + 'qemu-block-extra', + 'qemu-system', + 'qemu-system-modules-spice', + 'qemu-utils', + 'sasl2-bin', + 'swtpm', + 'swtpm-tools', + 'tpm2-tools', + 'trousers' + ] %} + + {% if base_arch == "aarch64" %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'qemu-efi-aarch64' + ] %} + {% elif base_arch == "x86_64" %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'ovmf', + ] %} + {% endif %} + + {% if base_distro in ['debian'] %} + {% set nova_libvirt_packages = nova_libvirt_packages + [ + 'usermode' + ] %} + {% endif %} +{% endif %} + +{{ macros.install_packages(nova_libvirt_packages | customizable("packages")) }} + +{% if base_package_type == 'deb' %} + +RUN rm -f /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/default.xml + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start +RUN chmod 644 /usr/local/bin/kolla_extend_start + +{{ macros.kolla_patch_sources() }} + +{% block nova_libvirt_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/nova/nova-libvirt-spice/extend_start.sh b/docker/nova/nova-libvirt-spice/extend_start.sh new file mode 100644 index 000000000..cc41b480b --- /dev/null +++ b/docker/nova/nova-libvirt-spice/extend_start.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ ! -e "/var/log/kolla/libvirt/libvirtd.log" ]]; then + mkdir -p /var/log/kolla/libvirt + touch /var/log/kolla/libvirt/libvirtd.log + chmod 644 /var/log/kolla/libvirt/libvirtd.log +fi +if [[ $(stat -c %a /var/log/kolla/libvirt) != "755" ]]; then + chmod 755 /var/log/kolla/libvirt + chmod 644 /var/log/kolla/libvirt/libvirtd.log +fi -- cgit v1.2.3