Libvirt OpenTofu provider
dmacvicar/libvirt
Server setup
- Follow debian wiki:installation
Create libvirt directpry storage pool (LVM doesn't work, see below):
virsh pool-create-as default --type dir --target /var/lib/libvirt/images
virsh pool-autostart default
Issues with LVM storage pool:
- Using a
backingStoreas baseimage and creating a bigger root LVM volume doesn't work, therefore sticking with directory storage pools for now. Related issues:
OpenTofu setup
Install on laptop (for cloud-init disk):
sudo pacman -S cdrtools
Cloud-init
Issues
- Changing some resources lead to their destruction and recreation
- Images are created with root user and I get access denied #978
Solution: Disable apparmor in
/etc/ibvirt/qemu.conf - Domain cannot get installed because of apparmor: See security/apparmor.md
Other OpenTofu providers
- Outdated, but still interesting: camptocamp/terraform-libvirt-k3s Although k3os is dead