[This is the final article in a three part series. Read part 1 and part 2.]
In this part I was going to discuss the different installation options, and I’ll give a quick introduction to each at the end. But you know? What I really need is this tool:
+--------------------------------------------------------+
| Rich's Amazing Bug Environment Reproducer Tool! |
+--------------------------------------------------------+
| Bugzilla number: # [545116] [ Go ] |
| |
| Preselecting Fedora Rawhide image. If this is wrong, |
| choose the right image from the list below: |
| |
| [X] Fedora Rawhide (x86-64) |
| [ ] Fedora 12 |
| [ ] Fedora 11 |
| [ ] Ubuntu 9.11 |
| [ ] Ubuntu 9.04 |
| [ ] Debian 6.0 |
| [ ] Debian 5.0 [Download more distributions] |
| |
| [X] x86-64 [ ] i386 |
| |
| [Create virtual machine now] |
+--------------------------------------------------------+
The Create virtual machine now button must take no more than 60 seconds to deliver the virtual machine, plus maybe another 60 seconds to boot it and give me the login prompt. I can then go in, configure it and reproduce the bug, and snapshot it, so I can go back and test fixes later. (I’d like the snapshot workflow to go through the user interface too, and ponies).
The only approach that doesn’t take ages to install is to have the distributions prebuilt as small disk images locally (as described already in part 2).
Note stuff I don’t want to have to specify: storage, download URLs, VM names, etc etc.
Why doesn’t this exist already, or perhaps it does?
I’d also like to suggest that the resizable disk image should become yet another distribution format that Linux distros provide. Many do already, albeit buried inside a live CD.
As promised, my quick summary of installation methods:
virt-install
virt-install is a great command line tool for installing new VMs. I have these two commands pretty much permanently in my command history:
# lvcreate -n F13Rawhidex64 -L 10G vg_trick
# virt-install -v -n F13Rawhidex64 --accelerate \
-r 512 -f /dev/vg_trick/F13Rawhidex64 \
--cdrom Fedora-12-x86_64-DVD.iso
The commands above lead to a manual installation, but you can also specify a kickstart file, although the syntax for doing this is not obvious and not documented in the manual page.
Nevertheless, even an install from a CD-ROM on the local drive (as in the example above) is a slow process, taking anything up to an hour.
kickstart
Kickstart is the method used to automate Anaconda installs, ie. installs of all Fedora, Red Hat and derived distributions. It’s a little unwieldy because you have to write a separate kickstart file, then host that on a web server (so the VM can find it), then add a special magic kernel parameter when booting the VM: ks=http://local.example.com/kickstart.ks
I found in the past that it’s better to keep a collection of kickstart files around and iterate them slowly so you can find out what works and what doesn’t.
Also, kickstarts are automatic, but just as slow as manual installation.
debootstrap
Debian’s debootstrap (and the Fedora equivalent I wrote called febootstrap) is, as far as I know, the standard way to install a new Debian instance from an existing Debian instance. Unlike our VM installs above, debootstrap creates a “chroot” directory, and what you do with that directory is then up to you. Usually you would debootstrap into some mounted device. debootstrap is very simple to use and driven completely from the command line.
It’s not particularly fast. Because it downloads, unpacks and installs each package, it can take an hour or more to run.
ubuntu-vm-builder
This is Ubuntu’s wrapper around debootstrap and libvirt/qemu.
cobbler
Cobbler is a network install server which lets you pxeboot and configure a network of machines (and virtual machines) from a central server. It has lots of wonderful features — go and read the web site.