Libvirt and OpenTofu
I’ve been using Terraform and Terragrunt to manage infrastructure on OpenStack and AWS for quite a long time, and I made the transition to OpenTofu (almost painlessly) when Hashicorp changed Terraform’s licensing. Recently I wanted to quickly create some VMs to play with a cloud-init configuration I was working on.
Since my laptop has qemu/kvm available via libvirt, I decided to try a libvirt
provider for tofu. In
line with other posts on here, I wanted the primary out-of-band management
interface to be serial, and since my motivation for this was to play with
cloud-init
I decided to start from one of the cloud images for ubuntu server.
Here are the terraform/tofu declarations I came up with (main.tf
).
OpenWRT on a Linksys E8450
We got a new router and decided to re-flash it with OpenWRT. The openwrt page for the E8450 covers the current support status. We went with the “non-UBI” installation because…
The caveat is that this change is essentially permanent so once you have OpenWRT, I hope you like it (I’m sure you will ;-). The official page says that since 2021-08-27, it is no longer possible to keep the default vendor flash layout (a.k.a. “non-UBI”), as it contains ECC errors out of the factory, and these errors are not compatible with the new SPI-NAND driver, that means you cannot install the non-UBI firmware (*.bin).
Installing Virtual Machines over a Serial Line - Again!
This is an update of a previous post where I argued for the importance of being able to control virtual machines using serial lines as an out-of-band tool. I still think that this is an important thing to do and this post gathers some updated examples.
UEFI Boot and Mirrored Disks - almalinux
This example is a test-bed for a physical (non-VM) install I needed to do on
a system which uses UEFI and where we wanted RAID1 support. The virt-install
command specifies --boot uefi
and two --disk
elements. These appear as
vda
and vdb
and the associated kickstart file builds RAID1 filesystems on
top. We have small partitions for /boot
and /boot/efi
and the rest of the
space is given to LVM. We configure LVs for /
, swap
and /home
.