dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

SPICE is no longer available in RHEL9/CentOS9 Stream #961

Open cfergeau opened 1 year ago

cfergeau commented 1 year ago

System Information

Linux distribution

Centos9 Stream/ RHEL 9

Provider and libvirt versions

terraform/providers/libvirt/go.mod:require github.com/dmacvicar/terraform-provider-libvirt v0.6.12

Checklist

Description of Issue/Question

terraform-provider-libvirt uses SPICE by default for its libvirtxml.DomainGraphic, but this has been deprecated/removed in RHEL9/CentOS9 Stream, see https://github.com/openshift/installer/pull/5622

[DEBUG] libvirt_domain.bootstrap: apply errored, but we're indicating that via the Error pointer rather than returning it: Error defining libvirt domain: virError(Code=67, Domain=10, Message='unsupported configuration: spice graphics are not supported with this QEMU')

terraform-libvirt-provider could parse the equivalent of virsh domcapabilities to make a better decision regarding which graphics element to add by default:

$ virsh domcapabilities
<domainCapabilities>
<!-- [...] -->
  <devices>
    <!-- [...] -->
    <graphics supported='yes'>
      <enum name='type'>
        <value>sdl</value>
        <value>vnc</value>
        <value>spice</value>
        <value>egl-headless</value>
      </enum>
    </graphics>
  </devices>
</domainCapabilities>

Or it could switch to VNC by default instead of SPICE.