Cobbler
From Consultancy.EdVoncken.NET
Cobbler and Koan are relatively young tools, developed by the Red Hat Emerging Technologies department. They aim to provide an easy solution for system provisioning. In the near future, Cobbler will be integrated with Spacewalk.
Cobbler manages provisioning using a tiered concept of Distributions, Profiles, Systems, and Repositories (see manpage).
- Distributions contain information about what kernel and initrd are used, plus metadata (required kernel parameters, etc).
Example: "RHEL 5.4, 64-bit". - Profiles associate a Distribution with a kickstart file and optionally customize the metadata further.
Example: "Webserver". - Systems associate a MAC, IP, and/or hostname with a profile and optionally customize the metadata further.
Repositories do not really fit in the tiered concept, but they are a valuable feature:
- Repositories contain yum mirror information. Using cobbler to mirror repositories is an optional feature, though provisioning and package management have a lot in common.
Contents |
Installing Cobbler
The RPMs are available from the EPEL repository.
Working with Distros
Import a DVD
Say you downloaded the CentOS DVD image, and wish to import that distribution into Cobbler:
mkdir /mnt/loop mount -o ro,loop /path/to/CentOS-54-x86_64-DVD.iso /mnt/loop cobbler import --name=centos54 --arch=x86_64 --path=/mnt/loop umount /mnt/loop
We need to loopback-mount the DVD image, because Cobbler cannot handle .ISO files directly.
Oh, and you can import lots of distributions, most are auto-detected by Cobbler. Some examples (I've omitted the "loopback-mount" commands here):
cobbler import --name=centos54 --arch=x86 --path=/mnt/loop/ cobbler import --name=rhel48-as --arch=x86 --path=/mnt/loop/ cobbler import --name=vmware-esx350-u1 --path=/mnt/loop/
If all is well, "cobbler list" should output something like this:
distro centos54-i386
profile centos54-i386
distro centos54-x86_64
profile centos54-x86_64
distro centos54-xen-i386
profile centos54-xen-i386
distro centos54-xen-x86_64
profile centos54-xen-x86_64
distro rhel48-as-i386
profile rhel48-as-i386
distro rhel48-as-xen-i386
profile rhel48-as-xen-i386
distro vmware-esx350-u1-i386
profile vmware-esx350-u1-i386
Working with Profiles
Cobbler creates default Profiles for each Distro. These profiles are not very useful in themselves; you either need to assign a proper Kickstart file to the profile, or add additional profiles with their own kickstart files.
Assign a Kickstart to a Profile
I tend to keep Profiles and Kickstarts in sync; for every Profile there is a dedicated Kickstart file. First, I assign a proper kickstart file to the default profiles:
cobbler profile edit --name=centos54-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos54-x86_64.ks cobbler profile edit --name=centos54-xen-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos54-xen-x86_64.ks
Inherit a Profile
When provisioning multiple hosts, there tend to be different roles (webserver, fileserver, etc.) that can be identified. I create separate profiles for these roles by inheriting the default profile for that distribution:
cobbler profile add --name=centos54-x86_64-dom0 --inherit=centos54-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos54-x86_64-dom0.ks
Here, I've created a new Profile ("centos54-x86_64-dom0") with its own Kickstart file. The new profile is based on the default profile, "centos54-x86_64".
In other words, profile "centos54-x86_64-dom0" inherits all settings from its parent profile, "centos54-x86_64". I can override any setting I want, in this example the location of the Kickstart file.
This new profile is intended for Domain 0 installations, i.e. the Xen host itself. I can create multiple specialized profiles as needed.
Working with Repos
Apart from the Yum repositories that come with your distribution, several other repositories exist:
- EPEL - Extra Packages for Enterprise Linux. Highly recommended.
- RPMforge - One of the participating repositories in the rpmrepo project.
Cobbler can manage a list of Yum repositories for you. It can also mirror the contents of a Yum repository, which helps reduce Internet traffic if you have a large number of hosts.
Let's add the EPEL repository for 64-bit RHEL/CentOS 5 (without mirroring the contents to the Cobbler server):
cobbler repo add --name epel5-x86_64 --mirror http://download.fedora.redhat.com/pub/epel/5/x86_64/ \ --mirror-locally 0
You must assign the repository to one or more profiles, or you will not be able to use it during installation:
cobbler profile edit --name centos54-x86_64 --repos epel5-x86_64
Note: the repository will only be available during installation. If you wish to use this repository after installation, install the "epel-release" package during install.
Installing a system
On a Xen Dom-0 server, you can use Koan to install a virtual guest into an LVM partition:
koan --server=atlas.example.local --virt --virt-type=xenpv \
--virt-name=zeus --virt-path=/dev/vg_md1/lv_zeus --profile=fedora10-x86_64-freeipa