Install and Configure Cobbler on Ubuntu 14.04

Linux ginotang 1004℃ 0评论

Install and Configure Cobbler on Ubuntu 14.04

Cobbler has always been my goto for provisioning bare metal servers. This is due in large part to its ability to provision CentOS, RHEL, Ubuntu, and Debian easily and quickly.

This post will cover setting up Cobbler on Ubuntu 14.04 and how to provision a server with Ubuntu Server 14.04.

Pick a Server

First and foremost, find and setup a server to act as your build server. The rest of this post will assume you are installing everything on that server.

Install Cobbler

Install the necessary packages:

Configure the DHCP Server

A key part of PXE booting is the DHCP server. Cobbler supports both dhcp3-server and dnsmasq. This post will only cover dhcp3-server.

Open /etc/cobbler/settings and set the following parameters (you will need to search for these parameters in the configuration file):

Open /etc/cobbler/modules.conf and set the following parameter (you will need to search for this parameter):

Open /etc/default/isc-dhcp-server and configure the network interface for the DHCP server to listen on:

Open /etc/cobbler/dhcp.template and configure your DHCP settings. Change the network, network ranges, and subnet mask to match your network:

Import Bootable ISOs

With the configuration files in place, it is now time to download the bootable ISOs and create a cobbler distro. This post will only cover importing Ubuntu Server 14.04.3.

Download the Ubuntu Server 14.04.3 ISO:

Mount the Ubuntu ISO:

Import the Ubuntu ISO into cobbler to create a cobbler distro:

Unmount the Ubuntu ISO:

Replace sources.list

Whether you use the included Preseed files with Cobbler or your own, unless explicitly set, Cobbler will rewrite the provisioned server’s sources.list file to pull packages from the Cobbler server. Unless you use Cobbler as a repository mirror, this is not a useful change.

The custom Preseed file in the next section will reference the default sources.list file you are able to download to ensure the provisioned server’s apt repositories download from instead of the Cobbler server.

Download the default Ubuntu 14.04 sources.list file:

Configure a Cobbler Profile

cobbler profile maps a Kickstart or Preseed file to a particular cobbler distro.

The default Preseed file included with a Ubuntu based cobbler profile is not unattended and will require user interaction during installation. Download the following custom Preseed which is unattended:

Next, create a new cobbler profile using the new Preseed file with the following command:

Finally, restart and sync Cobbler:

At this point, you can PXE boot any server that is on the same network as the Cobbler services ((tftpd, dhcpd, httpd) are listening on. Each server will PXE boot to a menu where you can select to continue to local boot or boot to the cobbler profile you created above.

If you are setting up a Cobbler server in Virtual Box and are having issues obtaining a DHCP address for PXE booting, you may need to enable Promiscuous Mode in Virtual Box for the interface the Cobbler services are listening on.

Configure a Cobbler System

If you want to be able to reboot a server and have it automatically begin installing Ubuntu Server without user interaction, you are going to need to setup a cobbler system.

First, get the MAC address of the network interface enabled to PXE boot from the to be provisioned server.

Second, figure out a hostname for the server and figure out what IP address you want to assign it. In this example, I will use for the hostname, for the IP address, and em1 as the network interface enabled to PXE boot.

Finally, with that information, create the cobbler system:

Reboot the server you want to provision and it should begin PXE booting on its own. After about 10 minutes, you should be at the Ubuntu login screen.

Cobbler Gotchas

Static DHCP Entry Disappears

If you created a cobbler system with static=1 and assigned it a static IP address, then use cobbler system edit to set netboot to false, and run cobbler sync, the static DHCP entry in /etc/dhcp/dhcpd.conf will disappear.

The fix is to remove static=1 from the cobbler system entry.

转自:Install and Configure Cobbler on Ubuntu 14.04

转载请注明:Pure nonsense » Install and Configure Cobbler on Ubuntu 14.04

喜欢 (0)
0 0 投票数
0 评论