Modifying my Perl YAML-based Provisioner for KVM

Introduction

In my last post, I discussed how I wrote a Perl script that uses a YAML file to build a list of virtual machines on the Xen hypervisor. When the script was nearly complete, it occurred to me: why not modify this script for use with libvirt/KVM? I mainly use KVM instead of Xen because of its better support for Enterprise Linux. Often, when I need to spin up a set of virtual machines for testing, I use dmacvicar/libvirt provider for Terraform. Usually this works pretty well; however, sometimes I get annoyed at having to learn the HCL language and just want to define a list of VMs with my specs. That is where I can see this script being of use, at least for myself. Of course, my intention was not to replace Terraform, even for myself. Mainly, this was a fun project that exercised my Perl skills and taught me stuff about Linux networking, libvirt, and more.

KVM host setup

Continue reading

Writing a Perl YAML-based Xen Provisioner

Introduction

In my previous post on the Xen hypervisor, I mentioned my interest in writing a Perl provisioning tool for Xen that functions similarly to Terraform. This tool isn’t meant to replace Terraform (nor claim that it is superior), but there doesn’t seem to be a Terraform provisioner for standalone Xen. Furthermore, sometimes it makes more sense to code a custom tool that does exactly what you want, versus trying to adapt an existing tool, especially a complicated one like Terraform. This tool has a single purpose: to give the user the ability to define a set of virtual machines with their specs (RAM, disk space, static IP addresses, etc.) and spin up these VMs with a single command, as well as take them down when they are no longer needed.

Continue reading

Building my own Xen images

In light of a few issues I’ve discovered with this post, I wouldn’t suggest that you use it as a guide. However, I’m leaving it up anyway, in case it is of use to someone. Instead, I recommend running pre-built cloud images from the OS vendor. I also recommend running using KVM for Enterprise Linux instead of Xen.

In my last post on Xen, I discussed using pre-built cloud images from Debian and AlmaLinux to create Xen virtual machines. These are convenient to use, but might not be ideal for certain use cases. For example, you might want certain packages to be included or excluded from your image, minimizing or even eliminating the role of cloud-init. Or for security reasons, you might not want to run an image from the internet on your local network. In this post, I will discuss how I built Xen images for AlmaLinux and Debian.

Continue reading

Xen Paravirtualization Part 2 – Debian

Introduction

In my last post, I explored running the Xen hypervisor on two deprecated versions of CentOS. In this post, I return to the present, setting up Xen on Debian 12 and 13, while using some of the techniques learned in the previous post. As is the case with a lot of my posts, this will involve a variety of topics, including Linux, networking, Perl, cloud-init, and more.

Continue reading

Configuring Ubuntu and Debian as a router

Recently, for my home network, I transitioned from using a standard home router running DD-WRT to a setup with a separate managed switch, wireless access point, and a combination router/server running Ubuntu 24.04. The “router” is a basic x86-64 mini-PC with two network interfaces, purchased for about $100. The internal interface hosts three VLANs (internal, lab, and guest) and provides DHCP, DNS, and LDAP services. I prefer this setup to something like OPNsense, because I can manage everything with the command line and Ansible. If the cheap PC dies an early death or I want to switch to something newer, I can simply install Ubuntu on the replacement system, configure the NICs, and run the Ansible project to configure everything else. It also gives me a low-power-usage PC that I can run other services on in containers or even virtual machines. In this blog post I run through the steps for configuring a router like this, with both Ubuntu and Debian.

Continue reading

Installing Debian on an old Buffalo NAS

A while back I took home a 2011-vintage Buffalo TeraStation TS-XEL that was destined to be e-wasted. I initially used it in its stock configuration, deploying it as a “junk” NFS server to store software and act as a storage back-end for a test Proxmox cluster. I quickly grew tired of it, however, as the OS on it was outdated and used deprecated protocols. I also prefer to manage systems through the command line and this NAS only could be managed through its web interface. After the initial novelty of having a “new” piece of hardware to play with wore off, I deposited it in the closet with the other pieces of hardware that get taken out every few years.

Continue reading