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

Secure Boot Support #967

Open git-noise opened 1 year ago

git-noise commented 1 year ago

System Information

Linux distribution

Ubuntu 22.04

Terraform version

Terraform v1.2.6
on linux_amd64

Provider and libvirt versions

0.6.14

Checklist

Description of Issue/Question

Setup

Not tf specific

Steps to Reproduce Issue

Not a bug


Additional information:

Do you have SELinux or Apparmor/Firewall enabled? Some special configuration? Have you tried to reproduce the issue without them enabled?

Not relevant here

Issue description

In its current state, it does not seem that the provider supports Secure Boot without some xslt modification.

  1. Secure boot may be relevant these days in virtualization, and as UEFI boot-loader are already supported via OVMF by the provider, it may make sense to extend the provider to allow for secure boot support?
  2. As we're tweaking the CPU, xslt may not be the best way to do the modification as the provider may not correctly detect the changes and try to re-apply a new VM, hence disrupting the existing one.
  3. As OVMF is already supported, enabling secure boot is essentially a matter of:
    • Enable SMM CPU feature
    • Enable Secure boot flag

Regarding code-base actual changes it means at least:

One caveat is that "secure" Secure Boot with SMM and OVMF needs Q35 - with all the implication of using Q35 over i440FX. On top of my head, missing IDE support would certainly impact cloud-init ISO workflows.

git-noise commented 1 year ago

@dmacvicar I have a working branch ready with aforementioned modifications - let me know if you're interested in merging such a feature.