Libvirt Terraform provider
- Run Debian 11 (Bullseye) on KVM using Qcow2 Cloud Image
- Outdated, but still interesting: camptocamp/terraform-libvirt-k3s Although k3os is dead
- dmacvicar/libvirt provider
Server setup
- Follow debian wiki:installation
- Unfortunatly, LVM storage pools can't be created yet with dmacvicar/libvirt
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
backingStore
as baseimage and creating a bigger root LVM volume doesn't work, therefore sticking with directory storage pools for now. Since LVM storage pool support is still not merged, I refrained from opening an issue for this. Related issues:
Terraform setup
Install on laptop (for cloud-init disk):
sudo pacman -S cdrtools
Cloud-init
Issues
- 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