I’ve been managing my virtual machines using Foreman for close to 2 years now, and that’s brought me a huge set of benefits in terms of how I test new code (or changes to existing code), and new packages. That’s just awesome :)
But repeated rebuilds of a machine lead to one small niggling problem. One which bites you on every rebuild. One which doesn’t stop you working, but requires a few extra keypresses after every rebuild, and possibly at every login.
This blog post has been in my to-write pile for nearly 4 months now. I have two laptops at home, both of which are capable of running a few virtual machines. If you missed the news, I now work on Foreman full time, so obviously I want to use Foreman to manage my virtual machines. So it seems like the perfect opportunity to give you a blog post about getting Libvirt set up on a host of your choice (in this case, my laptop).
Welcome back! In Part 1, we got our server set up to build Archlinux machines. Now we need to configure Foreman to make use of it! Let's get started...
UI configuration Operating System setupFirstly we need the Operation System. If you already have some Archlinux clients, this might already be done, but head over to the Operating System page:
and either edit the existing Archlinux OS, or create a new one if need be:
The Foreman developers have just merged a small patch which allows the UI to detect and correctly display Archlinux hosts. This means it's now possible to configure Foreman to do automated installs of Archlinux, just as you would for Debian or RedHat. This makes me happy, as people who know me might guess!
The problemThe thing is, Archlinux isn't easy to net-install. It pains me to say it (because I'm a big fan of Arch), but their approach to automated installs just doesn't fit with how super-smooth the rest of the distro is.
If (like me) you find yourself re-installing your machines a lot (and let's face it, that's what Foreman is for), then a package cache can save you a huge amount of data traffic. There are many ways to achieve this, but I'll describe how I'm using apt-cacher-ng to help me save data.
Apt-cacher-ng is particularly helpful since it can support almost any OS - the documentation has instructions for Debian, Ubuntu, Fedora, CentOS, OpenSUSE, and even Archlinux.