Cobbler is automatically installed in Linux, and cobbler is automatically installed in linux.

Source: Internet
Author: User

Cobbler is automatically installed in Linux, and cobbler is automatically installed in linux.
1 Introduction 1.1 PXE

The difference between PXE and RPL is that RPL is a static route and PXE is a dynamic route. RPL sends a request to the server based on the ID number of the NIC and other records. This ID data already exists on the server. If the matching succeeds, the server is remotely started. PXE specifies an IP address for this MAC address based on the MAC address of the workpiece station received by the server. Each start may have a different IP address from the previous start of the same workstation, that is, the dynamic allocation address. The following describes the principles of PXE in the client boot process:

After the client is started, PXE BootROM performs a self-test before obtaining control of the chip, and then sends a request to FIND a frame in broadcast form. If the server receives a request from the client, it will return a DHCP response, including the IP address of the client, the preset communication channel, and the boot image file; otherwise, the server will ignore this request.

After the client receives a response from the server, it will respond to a frame, send the required file to start the request, and write its MAC address to the Netnames. db file on the server. More messages are returned between the client and the server to determine the startup parameters.

BootROM uses the TFTP communication protocol to download the boot image document from the server.

After receiving the Startup File Using the TFTP protocol, the client transfers the control to the startup block to guide the operating system and complete remote startup.

1.2 KickStart

KickStart is an unattended installation method. The working principle of KickStart is to record various parameters required for manual intervention during a typical installation process and generate a file named ks. cfg file. In the subsequent installation process (not limited to the machine that generates the KickStart Installation File), when parameters are required, the installer first looks for the file generated by KickStart. When a proper parameter is found, the parameter is used. If no proper parameter is found, manual intervention is required by the installer. In this way, if the KickStart file covers all the parameters that need to be filled in during the installation process, the installer can only tell the installer where to get ks. cfg file, and then busy with your own affairs. After the installation is complete, the installer restarts the system based on the restart option set in ks. cfg and ends the installation.

 

1.3 Cobbler

Cobbler is a fast network-based linux installation service. It also supports windows installation on the network after adjustment. This tool is developed using python and is small and lightweight (only 15 K lines of python code). You can use simple commands to complete the configuration of the PXE network installation environment, you can also manage DHCP, DNS, yum repository, and create System ISO images.

Cobbler supports command line management and web interface management. It also provides APIs to facilitate secondary development.

Cobbler client Koan supports Virtual Machine installation and operating system re-installation, making it easier to reinstall the system.

Cobbler provides the following service integration:

* PXE Service Support

* DHCP Service Management

* DNS Service Management

* Power Management

* Kickstart Service Support

* Yum repository Management

2. Install and deploy 2.1 Related Files

1. Cobbler configuration file directory:/etc/cobbler

/Etc/cobbler/settings # Master cobbler configuration file

/Etc/cobbler/dhcp. template # DHCP service configuration template

/Etc/cobbler/tftpd. template # tftp service configuration template

/Etc/cobbler/rsync. template # rsync service configuration template

/Etc/cobbler/iso # iso template configuration file

/Etc/cobbler/pxe # pxe Template File

/Etc/cobbler/power # power Supply Configuration File

/Etc/cobbler/users. conf # Web Service Authorization configuration file

/Etc/cobbler/users. digest # user name and password configuration file for web Access

/Etc/cobbler/dnsmasq. template # DNS service configuration template

/Etc/cobbler/modules. conf # Cobbler module configuration file

2. Cobbler data directory:/var/lib/cobbler

/Var/lib/cobbler/config # configuration file

/Var/lib/cobbler/triggers # Cobbler command

/Var/lib/cobbler/kickstarts # the kickstart file is stored by default.

/Var/lib/cobbler/loaders # various pilot programs stored

3. system installation image Directory:/var/www/cobbler

/Var/www/cobbler/ks_mirror # list of imported System Images

/Var/www/cobbler/images # Start file of the imported System Image

/Var/www/cobbler/repo_mirror # yum source storage directory

4. log directory:/var/log/cobbler

/Var/log/cobbler/install. log # Client System Installation log

/Var/log/cobbler. log # cobbler log

2.2 install Cobbler 2.2.1 install EPEL Source

Yum install epel-release

2.2.2 install cobbler

Yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes cman pykickstart-y

2.2.3 configure cobbler

Vim/etc/cobbler/settings # Master Cobbler configuration file

Sed-I's/manage_dhcp: 0/manage_dhcp: 1/G'/etc/cobbler/settings

Sed-I's/manage_rsync: 0/manage_rsync: 1/G'/etc/cobbler/settings

# Set to 1 to enable Cobbler's DHCP management features.

# The choice of DHCP management engine is in/etc/cobbler/modules. conf

Manage_dhcp: 1

# Set to 1 to enable Cobbler's RSYNC management features.

Manage_rsync: 1

# If using cobbler with manage_dhcp, put the IP address

# Of the cobbler server here so that PXE booting guests can find it

# If you do not set this correctly, this will be manifested in TFTP open timeouts.

Next_server: 192.168.56.6

# This is the address of the cobbler server -- as it is used

# By systems during the install process, it must be the address

# Or hostname of the system as those systems can see the server.

# If you have a server that appears differently to different subnets

# (Dual homed, etc), you need to read the -- server-override section

# Of the manpage for how that works.

Server: 192.168.56.6

2.2.4 disable SELinux and iptables

Getsebool

Service iptables stop

Chkconfig iptables off

2.2.5 configure tftp and rsync

Set 'disable' to 'no'

Sed-I '/disable/c \ tdisable \ t = no'/etc/xinetd. d/tftp

Sed-I's/\=\ yes/\=\ no/G'/etc/xinetd. d/rsync

2.2.6 enable the wsgi Module

Sed-I's @ # LoadModule @ G'/etc/httpd/conf. d/wsgi. conf

2.2.7 generate Password

Generate the key and configure the default key, which is referenced by the ks file.

Openssl passwd-1-salt 'random-phrase-here ''wq'

$1 $ random-p $ 29HCOY0msGT. 4xVuIl6Gp.

Add cobbler Configuration

Vim/etc/cobbler/settings

Grep default_password_crypted/etc/cobbler/settings # modify it to the following Configuration:

Default_password_crypted: "$1 $ random-p $ 29HCOY0msGT. 4xVuIl6Gp ."

2.2.8 configure DHCP

Vim/etc/cobbler/dhcp. template

Allow booting;

Allow bootp;

Ddns-update-style interim;

Ignore client-updates;

Subnet 192.168.56.0 netmask 255.255.255.0 {

Range dynamic-bootp 192.168.56.100 192.168.56.254;

Option domain-name-servers 192.168.0.1;

Option routers 192.168.56.1;

Option subnet-mask limit 255.0;

Default-lease-time 1800;

Max-lease-time 3600;

Next-server 192.168.56.6;

Filename "pxelinux.0 ";

}

2.2.9 Configuration Service

/Sbin/service httpd start

/Sbin/service dhcpd start

/Sbin/service xinetd start

/Sbin/service cobblerd start

/Sbin/chkconfig httpd on

/Sbin/chkconfig dhcpd on

/Sbin/chkconfig xinetd on

/Sbin/chkconfig tftp on

/Sbin/chkconfig cobblerd on

2.2.10 boot system files

Cobbler get-loaders

2.2.11 configure debmiror (optional)

Yum-y install debmirror

Modify the/etc/debmirror. conf configuration file and comment out the @ dists and @ arches lines.

Sed-I's | @ dists =. * | # @ dists = | '/etc/debmirror. conf

Sed-I's | @ arches =. * | # @ arches = | '/etc/debmirror. conf

2.2.12 Check Configuration

Cobbler check

The following are potential configuration items that you may be want to fix: No need to handle

1: reposync is not installed, need for cobbler reposync, install/upgrade yum-utils?

2: debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run 'cobbler sync' to apply changes.

2.2.13 synchronization Configuration

Cobbler sync

2.3 Cobbler management 2.3.1 command description

Command reference

Cobbler -- help

Cobbler distro -- help

Cobbler distro add -- help

2.3.2 configuration file description

The Cobbler configuration file is stored in/etc/cobbler.

 

2.3.3 image data directory

Imported system releases, repos images and kickstart files are stored in/var/www/cobbler

Directory. Make sure that the/var directory has enough space to store these files.

 

2.3.4 data directory

This directory stores configurations related to Cobbler profiles, systems, and distros.

 

2.3.5 log files

Web log storage point:

/Var/log/httpd/access_log

/Var/log/httpd/error_log

/Var/log/httpd/ssl_access_log

/Var/log/httpd/ssl_error_log

Cobbler log:

/Var/log/cobbler. log

/Var/log/cobbler/install. log

You can use the Cobbler log to obtain the system installation status.

2.3.6 import an image

1. Check the md5 value of the downloaded ISO file to ensure data integrity.

Md5sum xx. iso

2. Create a directory

Mkdir-p/var/OS/Linux/Centos/x86_64/Centos6.7/dvd

3. Mount

Mount-o loop/var/iso/Linux/Centos/x86_64/xx. iso

/Var/OS/Linux/Centos/x86_64/Centos6.7/dvd

2.3.7 import data

Cobbler import -- path =/xx -- name = centos6.7 -- arch = x86_64

Cobbler list Configuration

Cobbler report details

Cobbler profile find -- distro = centos6.7-x86_64 # Check whether the configuration exists

Cobbler profile remove -- name = centos6.7-x86_64 # Delete the configuration file

Cobbler distro remove -- name = centos6.7-x86_64 # Delete distro

Cobbler profile find -- distro = centos6.7-x86_64 # Check whether the configuration is unavailable.

2.3.8 custom ks

Ks directory location

/Var/lib/cobbler/kickstarts/

Default ks location

/Var/lib/cobbler/kickstarts/sample. ks

Change the ks configuration file for the specified system version

Cp/var/lib/cobbler/kickstarts/sample. ks centos6.7-x86_64.ks

Cobbler profile add -- name = centos6.7 -- distro = centos6.7-x86_64 -- kickstart =/var/lib/cobbler/kickstarts/centos6.7-x86_64.ks

Cobbler check

Cobbler sync

KS example:

# Platform = x86, AMD64, or Intel EM64T

# Firewall configuration

Firewall -- disabled

# Install OS instead of upgrade

Install

# Use network installation

Url -- url = $ tree

# Root password

Rootpw root

# System authorization information

Auth -- useshadow -- enablemd5

# Use graphical mode install

Graphical

# Run the Setup Agent on first boot

Firstboot -- disable

# System keyboard

Keyboard us

# System language

Lang en_US

# SELinux configuration

Selinux -- disabled

# Installation logging level

Logging -- level = info

# System timezone

Timezone Asia/Shanghai

# Network information

Network -- bootproto = static -- device = eth0 -- gateway = 192.168.56.1 -- ip = 192.168.56.99 -- nameserver = 192.168.56.99 -- netmask = 255.255.255.0 -- hostname = host99 -- onboot = on

# System bootloader configuration

Bootloader -- location = mbr

# Partition clearing information

Clearpart -- all -- initlabel

# Disk partitioning information

Part/-- fstype = "ext4" -- ondisk = sda -- size = 8000

Part/boot -- fstype = "ext4" -- ondisk = sda -- size = 200

Part swap -- fstype = "swap" -- size = 1000

# Reboot after installation

Reboot

# Clear the Master Boot Record

Zerombr

% Packages

@ X Window System

@ Desktop

@ Development tools

Gcc *

% End

 

3. Web Management

The Cobbler web interface is a good front-end and is very easy to manage Cobbler. You can add and delete system, distro, and profile, and view and edit distros, profiles, subprofiles, systems, repos, and kickstart files.

3.1 cobbler web management 3.1.1 Installation

Yum-y install cobbler-web

3.1.2 set the User Password

Reset the password for the existing user cobbler:

Htdigest/etc/cobbler/users. digest "Cobbler" cobbler

Add a new user:

Htdigest/etc/cobbler/users. digest "Cobbler" newname

3.1.3 configure Logon

Sed-I's/authn_denyall/authn_configfile/G'

/Etc/cobbler/modules. conf

/Etc/init. d/cobblerd restart

/Etc/init. d/httpd restart

3.1.4 access the web

Browser access login page https://192.168.xx.xx/cobbler_web

3.1.5 log on to web3.1.6 to manage the web

Cobbler system add -- name = xx -- hostname = xx -- mac = xx

-- Interface = ethx -- ip-address = xx -- subnet = xx -- gateway = xx

-- Static = 1 -- profile = xx

Yum install cman ipmitool-y Power Management (hardware required)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.