Cobbler
Introduction
I recently discovered Cobbler, an server that assists in the automated deployment of Linux distributions.
A normal installation infrastructure is composed of several components: DHCP, DNS, PXE, TFTP, and the actual install media. Cobbler glues all of these components together very nicely. In addition, it provides dynamic configuration support by the way of kickstart files generated on the fly.
Although I have only scratched Cobbler’s surface, I’ve found it to be extremely worthwhile to learn and definitely supersedes my previous deployment setup.
Table of Contents
Installation
For my Cobbler server, I used CentOS 5.5 with all updates applied. RPMs of Cobbler exist in EPEL and it is recommended to use EPEL-testing:
$ rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
Once installed, edit /etc/yum.repos.d/epel-testing.repo and change enabled to 1 on all entries.
Next, I installed the following packages via yum:
$ yum install cobbler cobbler-web pykickstart
Once everything was installed, some standard services need enabled and started:
$ chkconfig httpd on $ service httpd start $ chkconfig xinetd on $ service xinetd start
Now enable and start Cobbler:
$ chkconfig cobblerd on $ service cobblerd start
Once Cobbler is running you can use the following command to see what configuration needs done:
$ cobbler check
Changes can be made in the /etc/cobbler/settings file. The file is very well documented so I won’t review anything here.
It is documented to run cobbler sync after any changes. This action is implied for the rest of this article.
I chose not to have Cobbler manage my DHCP or DNS server since I use dnsmasq on my test network gateway. However, I did need to tell dnsmasq to forward all PXE requests to Cobbler. I did so by adding the following to my dnsmasq.conf configuration:
dhcp-boot=pxelinux.0,cobbler,192.168.255.3
Cobbler should now be up and running and ready to serve installation requests.
Web Interface
Cobbler has a web interface that makes managing and configuring Cobbler very easy. Instructions on how to enable it can be found here.
Terms and Definitions
Cobbler is very organized with how it handles distributing installations. It uses three different components:
Distributions
A distribution is just that — a Linux distribution: CentOS 5.5, Fedora Core 12, Ubuntu 10.04.
Distributions can either be added or imported into Cobbler.
Importing is the easiest of the two. Given a DVD image or a mirror location, Cobbler can scan it and add it to the configuration:
$ mount /dev/cdrom /mnt $ cobbler import --name=CentOS55 --path=/mnt
Adding requires a few extra arguments. You will need to use add instead of import for cases when Cobbler cannot obtain enough information about the Distribution via the media you give it. An example of this scenario is with a Network Install version of a distribution:
$ cobbler distro add --arch=x86 --breed=ubuntu --name=10.04-LTS-x86_64 \ --initrd=/var/www/cobbler/ks_mirror/ubuntu-installer/amd64/initrd.gz \ --kernel=/var/www/cobbler/ks_mirror/ubuntu-installer/amd64/linux
Distributions are able to be installed and configured through the Web Interface, although I find the command line easier for this area.
Profiles
Profiles are the next item in the chain. I find it easier to relate the word “roles” with Profiles. For example, if you have a web server that will run CentOS 5.5, you would create a profile webserver-centos-55.
Profiles have the ability to be associated with a kickstart file.
To create a profile, you can either use the command line or the web interface. I prefer the web interface, however, if you want to use the command line, first get the name of the Distribution you want your profile to be based off of:
$ cobbler distro list
Then create a new profile:
$ cobbler profile add --name=(name) --distro=(distro) --kickstart=/path/to/kickstart.ks
Once the profile is created, if you were to PXE-boot a system, you will see a menu from Cobbler with the option of choosing this Profile.
Systems
The final component is Systems. A System is an individual machine that will have a profile applied to it. Systems can either us the Profile’s kickstart file, specify their own new kickstart, or override variables from the Profile’s.
Again, either the web interface or the command line can be used to add a system. To create one on the command line, first get the name of the profile you want to apply to your system:
$ cobbler profile list
Then create a system:
$ cobbler system add --name=(name) --profile=(profile) \ --mac=00:00:00:00:00:00 --ip=192.168.255.10 \ --hostname=test.example.com --name-servers=192.168.255.1 \ --gateway=192.168.255.1 --static=1
Cobbler will create a unique PXE entry for this computer based on the MAC address. When the computer is PXE-booted, it will bypass the normal menu and begin the installation immediately.
Conclusion
At this point, you should be able to PXE-boot computers and have Cobbler install profiles with the default settings. This is Cobbler at its most basic. It can also handle Virtual Machine deployment, DNS and DHCP management, and dynamic Kickstart configuration.
I highly recommend looking into Cobbler. It makes managing a deployment environment very simple and provides a solid set of tools to handle the organization and development of virtually any type of installation configuration you can imagine.

Deploying Ubuntu with Cobbler » Terrarum said,
[...] my previous article, I described the basics of Cobbler and how to get a simple installation up and running and distributing [...]
Caching RPMs with pkg-cacher » Terrarum said,
[...] than copying full DVDs to my Cobbler install server, I like to use network install versions of distributions. Using pkg-cacher along [...]
Gabriele Bozzi said,
Hi,
Latest Ubuntu version (Natty Narwhal for me) includes a Cobbler version that seems to support pre-seed files.
However the Web interface still has glitches, I made it work by creating my own pre-seed and by creating the right profile via command-line.
For those willing to peruse Ubuntu’s community docs:
https://help.ubuntu.com/community/Cobbler/Preseed
Joe Topjian said,
Hi Gabriele,
Nice information — thank you very much!
Add A Comment