Introduction
Hello World! It has been a few months since I’ve posted anything here, due to taking on a new role at work and having to learn new skills for it.
In a previous post, I described writing a Perl provisioning script for creating KVM virtual machines. The list of machines and attributes are defined in a YAML file, and then “spun up” using virt-install and cloud-init. It performs a similar role to Terraform, but is simpler and more focused. Mainly I wrote it to improve my Perl skills and learn more about libvirt, not replace Terraform entirely.
However, I later realized that the usefulness of this script is diminished by the fact that it can’t create libvirt NAT networks or provision virtual machines with static IP addresses. My first version used Dnsmasq for assigning addresses to the VMs; I’ve now soured on this approach. Instead, I’ve decided to re-factor this script to use cloud-init to assign a static IP address to the VM. This post will talk about the rewrite of the script.
