Cobbler, kickstart, and PXE boot

When working with Linux clusters, many tools used for operating system deployment can be integrated via Cobbler. Cobbler is a Linux installation server that allows for rapid setup of network installation environments. A typical process as a cluster administrator involves kickstart configuration files that need to be shared via HTTP, yum repositories, and perhaps a couple of different versions of the operating system that need to be available for over-the-network PXEboot install. Cobbler makes network installs much easier, maintaining your software repos, system profiles, and dhcp services.

Install RPMs
You can manually download the required RPMs into your own repo from EPEL or just install the epel-release-x.x.rpm if your system is online.

yum -y install cobbler cman createrepo dhcp httpd tftp-server yum-utils

Edit /etc/cobbler/settings

change “server” and “next_server” to internal IP address, ex:

manage_dhcp: 1
pxe_just_once: 1  # to avoid reinstall looping

Since we already have DNS running on another server, we don’t need to have Cobbler managing DNS or doing anything with bind.

Edit /etc/cobbler/dhcp.template
Note: this file takes precedence over /etc/dhcp.conf and overwrites it. First, copy /etc/dhcpd.conf to /etc/cobbler/dhcp.template, before starting cobbler services.

# /etc/cobbler/dhcp.template
ddns-update-style ad-hoc;
allow booting;
allow bootp;

subnet netmask {
  option subnet-mask;
  option broadcast-address;
  option domain-name "";
  option domain-name-servers;
  option routers;
  filename "/pxelinux.0";
  range dynamic-bootp;
host node1 {
  hardware ethernet 00:AA::BB:CC::DD::EF;
  option host-name "node1";

Confirm that firewall ports are open:
tcp+udp 53, 68, 69, 80, 123, 25150, 25151, 25152
Use system-config-securitylevel if on RHEL or CentOS.

Start services:

/etc/init.d/cobblerd start
service httpd restart

Install content for net boot loaders.

cobbler get-loaders

Edit these files:
/etc/xinetd.d/tftp, /etc/xinetd.d/rsync: set disable to no

Set processes to start at boot:

for i in xinetd cobblerd httpd dhcpd
chkconfig $i on
/etc/init.d/$i start

service cobblerd restart
service httpd restart

cobbler check

Follow configuration suggestions listed by ‘cobbler check.’

Begin setting up Cobbler profiles
Now it’s time to set up the three elements of cobbler: distro, profile, and system.

1. Define the distro with “cobbler import” for Red Hat base. By default, Cobbler
rsyncs the rhel dvd for you to /var/www/cobbler, unless you use ‘–available-as’

cobbler import --path=/rhel-5-server-x86_64 --name=rhel-5.5 --arch=x86_64 \
cobbler distro report

2. Add a repo for extra rpms to be included

cobbler repo add --mirror=/extras --name="extras"
cobbler reposync

3. Create the profile for compute nodes. If adding multiple repos, use quotes and space in between.
Copy the kickstart file to be used to a folder that is shared via the web, such as under /var/www/html and reference it here.

cobbler profile add --name=computenodes --repo="extras" --distro=rhel-5.5 \

Edit these lines in the kickstart file to point to the web shared OS install path/repo:

url --url
repo --name=extras --baseurl=

You will also have to configure each node’s IP address in the kickstart file, either manually or via a scripted variable. (grep last octet of IP address received on boot and dynamically add into configured IP in ifcfg-eth0 )

4. Add a system

cobbler system add --name=node1 --profile=computenodes --ip= \
--netmask= --hostname=node1 --mac=AA:BB:CC:DD:EE \
--static=true --netboot-enabled=true

Try running “cobbler system report” to view your new systems.

Run ‘cobbler sync’ one more time and the system should now be fully added to /tftpboot.

Remember that ‘cobbler sync’ also restarts dhcp services automatically. If you are part of a larger organization and not using central dhcp, it may be wise to double-check your dhcp.template to ensure that you are only broadcasting on your cluster’s internal network.

You should now be ready to install a new node on reboot.

If you choose to leave your system configured with the BIOS option to network boot first, simply disable the netboot option:

cobbler system edit --name=node1 --netboot-enabled=false

and re-enable it later if you need to rebuild it.

Cobbler is a great tool for system provisioning.

For those interested, check out my other blog page on automating Cobbler netinstalls with Ansible and VMware here.