diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-08-20 19:32:08 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-08-20 19:32:08 +0300 |
commit | cb437c9e3a1f7b25e1306e504656286c24186e4c (patch) | |
tree | c8314be1f48e51b0f145450c3a91a8b79390499e /README | |
parent | d6789ab0b7175173ea73723fc2a686097569bf6f (diff) | |
download | ansibleness-cb437c9e3a1f7b25e1306e504656286c24186e4c.tar.gz |
drop old crap
Sponsored-by: author
Diffstat (limited to 'README')
-rw-r--r-- | README | 48 |
1 files changed, 0 insertions, 48 deletions
@@ -1,48 +0,0 @@ -Managing my virtual machines -============================ - -I have a laptop with 16 GiB RAM, which is enough to run a few virtual -machines. I make use of this to run VMs as, for example, workers for -my CI setup, such that I have two or three versions of Debian -(oldstable, stable, unstable) and two CPU architectures (i386, amd64). -This lets me test the software I develop on a large fraction of the -environments in which my users run it on. - -I have a few other VMs as well. Managing all of these would be tricky, -but I've gathered some tools for this: - -* The actual virtualisation is KVM, managed by libvirt. This is less - invasive than running OpenStack of similar cloud services on my - laptop. - -* I use Ansible for configuration management. It's easy to use, and - doesn't require Ruby or running an agent on each machine. - -* I create each VM from a base image. The base images are created by - vmdebootstrap, a tool I wrote and that Neil Williams now maintains. - The base images have a minimal install, with a user `ansible` that - is allowed passwordless sudo, and an `authorized_keys` file that - allows my Ansible to log into them and do things. - -The creation of a new VM is a somewhat intricate process: - -* Create a new LV of the same size as the base images. - -* Unpack the correct base image onto the LV. The base images are - stored compressed in an archive location. - -* Create the VM, with `virt-install`. This chooses a random MAC - address for the new VM, and also starts it. - -* Find the new VM's MAC address in the - `/var/lib/libvirt/dnsmasq/default.leases` file, and pick out the IP - address given to it. - -* Add to `/etc/hosts` a line that gives the VM's IP address a name - that's the new VM's hostname. - -All of the above is automated into a script. - -After this, the new VM can be managed by Ansible. Ansible gets run -manually after the VM creation script, and after I've added the new VM -to my Ansible config. |