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

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

A Retrospective: Xen Paravirtualization Part 1 – CentOS 5 and 6

Introduction

A blog post about CentOS 5 or 6 isn’t going to excite anyone or show up in many intentional Google searches. CentOS 5 and 6 are 18 and 14 years old respectively in 2025 and are mostly viewed as insecure at this point; they also haven’t reached the point of being “retro cool” yet (and may never be). However, for me there will always be a certain amount of nostalgia for these operating systems, CentOS 5 in particular: it and related Enterprise Linux 5 variants were the first Linux distributions I used in my work—previously I had only used Ubuntu, Debian, and Fedora on the desktop. My first home server also ran CentOS 5, with 6-8 VMs running on a Xen hypervisor in paravirtualized mode. Paravirtualization at the time provided better performance than full virtualization (VMWare ESXi, KVM, VirtualBox, etc.) and allowed running VMs on CPUs that didn’t have virtualization extensions. My main home server at the time supported hardware virtualization, but I was also able to run Xen on some spare systems that did not, such as a Pentium D desktop with only 2GB of RAM. My impressions at the time were that Xen was lightweight, resilient, and easy to configure. The bridged network functioned right out of the box and the machine config files consisted of only a few lines. Thus it was with some reluctance that I eventually rebuilt my lab with CentOS 6 and KVM. Since then, I’ve always been a KVM user and my experience with it has been mostly positive. Still, my perpetual dislike of libvirt’s XML files and excessive number of virsh subcommands has made me nostalgic for my first lab setup with Xen. In this post I will fire up Xen once again on both CentOS 5 and 6, while doing a little bit of scripting to make it more interesting.

Continue reading