Warewulf v4 Sandboxing Environment on KVM using Vagrant
Warewulf is a stateless and diskless container operating system provisioning system for clusters of bare metal and/or virtual systems.
Playing with Warewulf usually need a server and a few nodes, wire them and place them around your desk. This post shows you how to build Warewulf v4 sandboxing environment on KVM, full virtualization solution, using Vagrant.
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V).
By using KVM, we can build a server and a few nodes as virtual machine on your workstation. We can manually build virtual machines on each trial, playing with Warewulf and/or development of Warewulf itself. But with the help of Vagrant, we can automate this process as code.
Vagrant is a tool for building and managing virtual machine environments in a single workflow.
Here is my Vagrantfile on Github, that automate provisioning process of Warewulf v4 sandboxing environment. It builds a Warewulf server and two nodes for general purpose.
Install KVM on Rocky Linux 8.5
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
dnf install -y vagrant \
@virt qemu-kvm virt-manager virt-viewer virt-install
Install KVM on Ubuntu 20.04
apt install -y vagrant \
qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils \
virtinst virt-manager libguestfs-tools
Before start provisioning Warewulf sandboxing environment using above Vagrantfile, we need to install vagrant-libvirt plugin.
vagrant plugin install vagrant-libvirt
Download Vagrantfile (or git clone https://github.com/panda1100/warewulf-on-kvm.git )
mkdir ww_sandbox
cd ww_sandbox
wget https://gist.githubusercontent.com/panda1100/41ecafa7ad77bf3a79d1d8263539a03d/raw/437820c7d81706eaf8e2f43fde60955cb4fb5300/Vagrantfile
Let’s start provisioning Warewulf server.
vagrant up
SSH to Warewulf server and check warewuld is running
vagrant ssh server
sudo wwctl server status
You will see a message like following
Warewulf server is running at PID: 27562
Provisioning n0001
and n0002
, general purpose nodes
vagrant up n0001
vagrant up n0002
SSH to n0001
and n0002
to verify both of nodes are running
vagrant ssh server
sudo su
ssh -t n0001 sl
ssh -t n0002 sl