If you’ve been following along, you now have a system installed and configured for creating virtual guests using cobbler. Additionally, cobbler-1.4.0 has been released. I recommend upgrading as there are numerous bug fixes and enhancements that will make life easier (and are required in my setup).
With this setup, you can do just about anything you like with your virtual guests.
- Need a couple of dedicated systems to test some bodhi updates?
- Check out the state of rawhide?
- Want a disposable system to use for an upcoming Fedora Test Day?
- Or testing out a new Fedora Live image?
I use the my cobbler setup to aid testing the installer, both manual and semi-automated. Let’s start with …
In this scenario, I’ll configure my guests to boot the installer, but wait for me to manually walk through different use cases. For my installs, I’m going to use Fedora 10 x86_64 which I previously imported using cobbler. Also, I’ll reference the virtual system names created in a previous post (e.g. vguest1, vguest2, etc…).
- First, create a kickstart file which we will use only to provide a location for the installation source. The $tree variable will be filled in later by cobbler.
# echo "url --url \$tree" > /var/lib/cobbler/kickstarts/manual.ks
- Next, let’s start fresh and remove any virtual guests that are running.
# virsh destroy vguest1 # virsh undefine vguest1
- Now, tell cobbler what we want to do …
# cobbler system edit --name vguest1 \ --profile F-10-GOLD-x86_64 \ --kickstart /var/lib/cobbler/kickstarts/manual.ks
- Finally, using koan, start the install.
# koan --server `hostname` --system vguest1 --virt
- If all goes well, you should be able to connect to the console of your guest.
# virt-viewer vguest1
Using the above procedure, you can quickly initiate as many virtual installs as your system (cpu, memory and disk) can handle. Five installs at one time is about the maximum my brain can handle while remembering what I’m trying to accomplish on each system. I repeat the above steps so frequently, I include them in a small shell script for convenience.
Using my script, the above steps can be simplified with just:
# ./install-virt-guest.sh -n vguest1 -p F-10-GOLD-x86_64 -k manual.ks
A bulk of installation testing lies in understanding and using kickstart. The quickest way to get started with kickstart, is to start with a known good kickstart file. From there you can adjust the kickstart to meet your needs.
For me, a great place to look for something to automate is in the Fedora 10 installion test plan. Looking at the test plan, I see that installation using ext4 file systems is not listed. Probably something we’ll want to test in the future. Let’s get started …
- On your cobbler server, copy the sample.ks kickstart template to a new filename.
# cp /var/lib/cobbler/kickstarts/sample.ks /var/lib/cobbler/kickstarts/ext4.ks
- Now edit the new file and replace the following line:
With something similar to the following lines:
part /boot --fstype ext3 --size=200 part swap --fstype swap --size=512 --grow --maxsize=2016 --recommended part / --fstype ext4 --size=1024 --grow
- That’s it! Let’s kick off an install on another install using our new cobbler kickstart template.
# ./install-virt-guest.sh -n vguest2 -p F-10-GOLD-x86_64 -k ext4.ks -c "ext4"
I’ll leave modelling additional installs using cobbler kickstart templates for the reader. But hopefully this demonstrates how you can easily and quickly perform routine installs using cobbler kickstart templates. You may also wish to further modify your cobbler kickstart templates to meet your needs.
In my next post, I’ll outline how I use SNAKE kickstart templates in place of cobbler templates to allow for more robust kickstarts over time.