Automated Installation with the Cobbler Provisioning Tool
Total Page:16
File Type:pdf, Size:1020Kb
Cobbler BEFN$?FN 8lkfdXk\[`ejkXccXk`fen`k_k_\:fYYc\igifm`j`fe`e^kffc E<NJ?F<J Cobbler helps you install new systems in a hurry. We’ll show you how to use this nifty shoemaker to deploy Xen and VMware virtual machines. BY DAVID NALLEY f you try to install or upgrade several uniform environment and does not take article, I show you how to set up a Cob- computers at once, you will soon into account differences in hardware or bler provisioning system and take a look @discover that manual installation is a function. Also, the image gets out of at the provisioning of virtual machines huge time sink. Even if you are working date over time – with the constant ap- with Cobbler’s helper application Koan. with a checklist, it is often difficult to get pearance of updates, managing the im- Cobbler provides a framework for con- everything installed the same way every ages can become a full-time job. The figuring and managing: time. For this reason, most systems ad- more robust way of provisioning is by ministrators understand the importance automatically installing the operating of an automated install system. system each time, rather than relying on It’s no surprise that virtually every op- a predefined disk image. This method is erating system has the ability to auto- generally considered more challenging. daemon mate installations. What is curious, The Cobbler project [2], born at Red By managing all the configurations for given the necessity of such systems, is Hat and lead by Michael DeHaan, signifi- all services, Cobbler literally can run an that configuring automated installation cantly lowers the barrier for provisioning entire provisioning network from a sin- typically requires so much time and ef- in Linux. Cobbler is an all-encompassing gle box. Of course, you don’t have to use fort. In the past, automated installation framework for automated provisioning Cobbler to configure all these services required a fair amount of knowledge systems that provides a “soup-to-nuts” about networking, Pre-eXecutable Envi- solution, bringing together provisioning ronment (PXE), and, of course, the oper- prerequisites like DHCP and TFTP, pro- Table 1: Required Ports ating system itself. Those prerequisites viding management utilities for control- and Services represented a significant barrier to entry. ling software repositories, and offering Port Service Automated provisioning techniques up a framework to enable both a com- TCP 53 DNS have taken a number of forms over the mand-line and web interface for easy UDP 53 DNS years. The approach familiar to most management (Figure 1). UDP 68 DHCP people is taking a disk image of a system In addition to handling hardware- UDP 69 TFTP with the use of dd, PING (Partimage is based installs, Cobbler is proficient at TCP 80 HTTP not Ghost) [1], or another tool, then de- configuring virtual machines: You can UDP 25150 Remote syslog ploying that disk image anytime you provision a collection of Xen or KVM vir- TCP 25151 XMLRPC need it. Unfortunately, this solution tual machines as easily as a new hard- TCP 25152 XMLRPC doesn’t scale well because it relies on a ware-based server or workstation. In this JANUARY 2009 ISSUE 98 51 051-055_cobbler.indd 51 13.11.2008 18:41:30 Uhr BEFN$?FN Cobbler and DHCP servers if they are already present. In the event they aren’t, you can use Cobbler to manage the daemons and their configurations. Aside from letting you manage dae- mons, Cobbler provides a framework to mirror the installation framework from a DVD or an Internet repository. Addition- ally, Cobbler can mirror and keep cur- rent with third-party repositories. In the event that PXE booting isn’t an option, that will present the user with the same installation options that are presented to a machine that uses PXE. A single Cobbler command will down- load an operating system from the Inter- =`^li\)1<[`k`e^XB`ZbjkXikk\dgcXk\% and make the system ready for deploy- ment. Another command grabs all of the ent sets of packages and pushes differing the operating system is installed, you packages from an update repository. configuration files based on that logic. can set up Cobbler and its dependencies. Most discussions of Cobbler focus on For example, Cobbler allows you to push For the remainder of this article, I’ll as- its ease of use, but equally important is sume you plan to use Cobbler as an all- its power and flexibility. For instance, your development machines might get in-one provisioning system and that it Cobbler allows you to use snippets of - code across many configuration files. If ers get a different set. Cobbler is available in the standard re- a snippet of code needs to be in multiple This example is just a simple demon- pository set with Fedora, but with RHEL Kickstart files, you can place it in one stration of the type of flexibility that file. The classic use for this feature is Cobbler has built in. Another feature repositories. To install Cobbler, enter: - that is getting a lot of attention is Cob- bler’s integration with configuration yum install cobbler httpd 5 Rather than being limited to simple in- management systems such as Puppet. dhcp bind tftp-server cludes, Cobbler has the power to dynam- ically insert code snippets so you can @ejkXcc`e^:fYYc\i programmatically change the configura- Although packages are available for Cob- need to configure it so that Cobbler can tion on the basis of the type of machine, bler in Debian and Ubuntu, they are still serve up the dynamically configured function of machine, IP address, or a very much in development. At the time Kickstart files: host of other factors. This approach al- of this writing, a machine with Fedora 8 lows you to have a single Kickstart file setsebool -P 5 with embedded logic that deploys differ- be a better candidate for Cobbler. Once httpd_can_network_connect true If you change the /etc/cobbler/settings file to contain the following settings, Cobbler will manage configuration and - lation client. The server and next_server settings relate to PXE booting and are used in configuring DHCP and defining where machines should look to get boot information. In this case, the cobbler server has the address 192.168.1.5: manage_dhcp: 1 manage_dns: 1 next_server: '192.168.1.5' server: '192.168.1.5' If you use an address other than =`^li\(1:fYYc\iZfd\jn`k_Xefgk`feXcn\Y$YXj\[`ek\i]XZ\% 192.168.1.5, modify /etc/cobbler/dhcp. 52 ISSUE 98 JANUARY 2009 051-055_cobbler.indd 52 13.11.2008 18:41:33 Uhr Cobbler BEFN$?FN template appropriately to match the net- Listing 1: Cobbler’s Configuration Check work you have chosen. If you don’t do 01 [root@nalleyt61 ~]# cobbler check 09 #3: One or more kickstart this, machines will unsuccessfully at- 02 The following potential problems 10 templates references default tempt to PXE boot to the 192.168.1.5 03 were detected: 11 password 'cobbler' and should address, and machines booted with a 04 #0: service cobblerd is not running 12 be changed for security reasons will vainly attempt to reach installation 05 #1: service httpd is not running 13 : /etc/cobbler/sample.ks, repositories on 192.168.1.5. 06 #2: since iptables may be running, 14 /etc/cobbler/legacy.ks, In /etc/cobbler/named.template, you’ll 07 ensure 69, 80, 25150, and 25151 are 15 /etc/cobbler/sample_end.ks want to set the listen_on variable to 08 unblocked match the IP address of the Cobbler server. This step defines one of the few One of the interesting features of Cob- cobbler reposync information items Cobbler needs to con- bler is that it provisions systems dynami- cally based on the latest packages. This For a home setup or installfest, you course, it instructs the bind configura- means that if Cobbler knows about an might disregard the following setting, update repository, it will install the latest but if Cobbler will be running in a large updated packages in that repository. lab or in a corporate environment, you This can save lots of time by eliminating will want to point your installed ma- listen-on port 53 5 post-install updates, particularly if it has chines at the repositories Cobbler is now { 192.168.1.5; }; been a long while since the distribution keeping locally. This allows you to main- was released. Also, you are not limited tain a local update repository and update If you are using a firewall, make sure to update repositories; you could just as all of your machines based on that re- you open the ports shown in Table 1. easily use a repository for Dell’s Open- pository. You can change this setting in /etc/cobbler/settings to match: >\kk`e^k_\9`kj packages or some other third-party re- Now it is time to import the first distri- pository. yum_post_install_mirror: 1 bution. Cobbler makes this an easy, one- To define an update repository, use the command step, with only two argu- cobbler repo add command, assign the Cobbler uses the concept of a profile to ments: the name you assign to the distri- repository a name, and then specify the define a collection of common configura- bution and the location of the installa- location: tion settings. A Cobbler profile consists tion data. The installation files can be of a distribution, optionally one or more pulled from install media or from the cobbler repo add 5 additional repositories, and the installa- Internet. --name=F9-updates tion configuration file.