2012年1月10日 星期二

Cobbler 筆記
What is Cobbler?
  • Linux installation server
    • Setup of network installation environments
      • PXE, media-based net-installs, and virtualized installs ( supporting Xen, qemu, KVM, and some variants of VMware)
  • Automates many associated Linux tasks
    • Do not have to hop between lots of various commands and applications
    • DNS, DHCP, package updates, power management, configuration management orchestration
  • There is also a lightweight built-in configuration management system
    • Dupport for integrating with configuration management systems like Puppet
  • Command line interface or web interface

What can we do via Cobbler?
  • Physical Machine Installation
    • Basic PXE setup
    • Manage Yum and Apt Repos
    • Re-installation with Koan when PXE is not possible
    • Build iso when PXE and DHCP not available
  • Virtualization Automation
  • Kickstart Templating
    • Kickstart templating
      • Uses Cheetah as the kickstart templating engine
    • Kickstart Snippets
      • common part, re-usable code
  • Package Update Mirroring Features
    • Handle yum and apt
  • Network Management Features
    • DHCP
      • not really understand
    • DNS
      • not really understand
    • Bonding and VLAN
      • not really understand
  • Configuration Management
    • Built-in Configuration Management
      • focused around packages and templated configuration files
    • Integrate with puppet or cfengine3 or chef
      • better support for Redhat-based OSes and for Puppet
      • Put initial configuration as part of the CMS, and keep the Cobbler set-up simple and uncluttered.
      • set up Cobbler to deploy tailored sets of packages to different types of machines, then use the CMS to do relatively small-scale fine-tuning of that.
  • Power Management
    • not really understand
  • Replication
    • replicate configurations to other cobbler servers

How Cobbler works?
    • XMLRPC API is used to interact with cobbler via the cobblerd daemon
      • You want to talk to Cobbler and you are not a Python application/script
      • You want to talk to Cobbler and are not running on the Cobbler server
      • You are a non-GPLd application that wants to talk to Cobbler that is to be distributed to the public or customers
  • Trigger
    • do X when cobbler does Y, Python module
    • Not really understand

Basic Terms

Cobbler uses a tiered concept of Distributions, Profiles, Systems, and (optionally) Images and Repositories
  • Distributions contain information about what kernel and initrd are used, plus metadata (required kernel parameters, etc).
  • Profiles associate a Distribution with a kickstart file and optionally customize the metadata further.
  • Systems associate a MAC, IP, and other networking details with a profile and optionally customize the metadata further.
  • Repositories contain yum mirror information. Using cobbler to mirror repositories is an optional feature, though provisioning and package management share a lot in common.
  • Images are a catch-all concept for things that do not play nicely in the "distribution" category. Most users will not need these records initially and these are described later in the document.

Use Case 1
  • you have either a DVD or ISO file of your OS's distribution
  • the server has sufficient local disk space available at /var/www/cobbler to unpack that DVD/ISO
  • the server and clients share a common IP network
  • the server is the only instance of a DHCP server on this network
  • the client is capable of PXE network booting on this network

On the cobbler server:
# Review the procedure below.  The command arguments "--foo=bar" will need to vary locally.

# Install cobbler. The command below assumes a Redhat-like OS.
yum install cobbler

# Show what aspects might need attention
cobbler check

# Act on the 'check' above, then re-check until satisfactory.
# (Details beyond the scope of this particular example.)

# Import a client OS from a DVD.  This automatically sets up a "distro" and names it.
# (See below ISO file variant.)
cobbler import --path=/mnt --name=rhel5 --arch=x86_64

# Create a profile (e.g. "rhel5_workstation") and associate it with that distro
cobbler profile add --name=rhel5_workstation --distro=rhel5

# Set up a kickstart file.
# (Details beyond the scope of this particular example.)

# Associate a kickstart file with this profile
cobbler profile edit --name=rhel5_workstation --kickstart=/path/to/kick.ks

# Register a client machine (e.g. "workstation1") and its network details
# and associate it with a profile
cobbler system add --name=workstation1 \
  --mac=AA:BB:CC:DD:EE:FF --ip=III.JJJ.KKK.LLL \
  --profile=rhel5_workstation \

# Get a detailed report of everything in cobbler
cobbler report

# Get cobbler to act on all the above (set up DHCP, etc.)
cobbler sync

Try it. Go to "workstation1" and attempt to boot it over the network.

Quick Notes

看完後, 大致了解 cobbler 的運作流程是先在 cobbler server 登錄即將加入的機器, 讓 cobbler server 可以認得這台機器,接下來定義每一層的連結 (System -> Profile -> Distribution + Kickstart ), 其中可動態客制化的部份是靠 Kickstart,然後把機器打開後,透過 PXE Installation 把工作完成,這是最基本的流程。

可是更棒的流程應該是我們可以在一個特定的環境內加入一台新的機器, cobbler server 就能自動抓到這台機器,然後我們透過選單指定他的 Profile, 然後一切的工作就完成了! 這樣的功能在

有提到,不過我看的不是很懂,之後有空再研究,總之 cobbler 的功能定義的非常清楚,就是 "Installation",至於 Configuration 可以靠 Puppet / Chef


Machine lifecyle
  • installation 
  • initial configuration 
  • ongoing configuration and maintenance 
  • decommissioning

1 則留言:

張旭 提到...

>> Build iso when PXE and DHCP not available

請教一下,這個是指 Cobbler 會打包一個 iso,
接着 user 再把這個 iso 燒錄成光碟拿去安裝嗎?