CentOS 6.5 Automated Operation Koriyuki based on cobbler Service automated installation operating system detailed

Source: Internet
Author: User



First, cobbler installation

Prerequisite: The cobbler is provided by the Epel source, so it is necessary to configure the Yum source to Epel in advance to perform similar installation procedures.


# yum install-y epel-release# yum install-y cobbler cobbler-web pykickstart debmirror# service httpd start# Service Cobb Lerd start# SS-TUANLP | Grep:25151tcp    LISTEN     0      5              127.0.0.1:25151                 *:*      Users: (("Cobblerd", 1820,8))


Perform the Cobbler check command to examine the problems that are stored, and then follow the prompts to resolve them individually. The common problems are as follows:
1:the ' server ' field in/etc/cobbler/settings must is set to something other than localhost, or kickstarting features WI  ll not work. This should is a resolvable hostname or IP for the boot server as reachable by all machines that'll use it.2:for PXE t o Be functional, the ' next_server ' field in/etc/cobbler/settings must is set to something other than 127.0.0.1, and Shoul D match the IP of the boot server on the PXE network.3:some network boot-loaders is missing From/var/lib/cobbler/loade RS, you could run ' cobbler get-loaders ' to download them, or, if you have want to handle x86/x86_64 netbooting, may Ensu  Re so you had installed a *recent* version of the Syslinux package installed and can ignore this message entirely.  Files in this directory, should want to support all architectures, should include pxelinux.0, MENU.C32, Elilo.efi, and Yaboot. The ' Cobbler get-loaders ' command is the easiest-to-resolve these requirements.4:change ' disable ' to ' no ' in/etc/xi Netd. D/rsync5:comment ' dists ' on/etc/debmirror.conf for proper Debian support6:comment ' arches ' on/etc/debmirror.conf fo R proper Debian support7:the default password used by the sample templates for newly installed machines (default_passwor D_crypted in/etc/cobbler/settings) is still set to ' cobbler ' and should ' changed, try: ' OpenSSL passwd-1-salt ' random -phrase-here ' Your-password-here ' to generate new one8:fencing tools were not found, and is required to use the (Opti onal) power management features. Install Cman or fence-agents to use them


Restart Cobblerd and then run ' Cobbler Sync ' to apply changes.

The workarounds for the above problems are as follows:

1. Modify the value of the server parameter in the/etc/cobbler/settings file to the corresponding IP address or hostname of the host that provides the cobbler service, such as 192.168.8.42;

2. Modify the value of the Next_server parameter in the/etc/cobbler/settings file to the corresponding IP address of the host that provides the PXE service, such as 192.168.8.42;

3, if the current node can access the Internet, execute "Cobbler get-loaders" command, otherwise, you need to install the Syslinux package, where we installed cobbler when the syslinux is installed, direct replication/usr/share/ SYSLINUX/{PXELINUX.0,MEMU.C32} and other files to the/var/lib/cobbler/loaders/directory;
# CP/USR/SHARE/SYSLINUX/{PXELINUX.0,MENU.C32}/var/lib/cobbler/loaders/

4, the implementation of "Chkconfig rsync on" command can be;

5. Note "@dists =" Sid "in the/etc/debmirror.conf file;" Line
# @arches = "i386";

6. Note "@arches =" i386 "in the/etc/debmirror.conf file;" Line
# @arches = "i386";

7. Perform "OpenSSL passwd-1-salt $ (OpenSSL Rand-hex 4)" To generate the password and replace the value of the default_password_crypted parameter in the/etc/cobbler/settings file with it;
# OpenSSL passwd-1-salt $ (OpenSSL Rand-hex 4) Password: $1$02A40DAC$KLQ7OPRMBSV9U/RKJKO2L1

8, the implementation of "Yum install cman fence-agents" command to install the corresponding package can be;

# vim/etc/xinetd.d/tftp
Change disabled to No


Then restart Cobblerd, then perform "Cobbler Sync" to synchronize the new configuration to Cobbler


Note:
Error: File/etc/xinetd.d/rsync does not exist
Actually the/etc/xinetd.d/rsync file exists, this article ignores


Ii. configuration and start-up of the services cobbler relies on

The operation of the cobbler relies on DHCP, TFTP, rsync, and DNS services. DHCP can be provided by DHCPD (ISC) or by DNSMASQ, TFTP can be provided by the Tftp-server package, or it can be provided by the Cobbler's own TFTP feature, which is provided by the Rsync package, and DNS is provided by BIND. Can also be provided by DNSMASQ.


Cobbler can manage some or all of these services on its own, but need to configure the "Manage_dhcp", "manage_tftpd", "Manage_rsync", and "Manage_" in the/etc/cobbler/settings file DNS "is defined separately. Also, because each service has a different implementation, if you need to customize it, you need to modify the values of the module parameters for each service in the/etc/cobbler/modules.conf configuration file.

This article uses an independent management approach that does not manage these services through cobbler.

2.1 Configuring the DHCP service

# yum Install-y DHCP

Define the required "subnet" and other parameters or options, and then start the DHCPD daemon. The configuration of the dhcpd used in this example is as follows:

Option Domain-name "chinasoft.com"; option Domain-name-servers 192.168.8.251,8.8.8.8;default-lease-time 43200; Max-lease-time 86400;log-facility local7;subnet 192.168.8.0 netmask 255.255.255.0 {        range 192.168.8.210 192.168.8.215;        Option routers 192.168.8.254;} Next-server 192.168.8.42;filename= "pxelinux.0";

You can then use the Restart service to
# Service DHCPD Restart

2.2 Configuring the TFTP service

# chkconfig TFTP on# service xinetd restart# netstat-unlpactive Internet connections (only servers) Proto recv-q send-q Lo                 Cal address Foreign address State Pid/program name UDP 0 0 0.0.0.0:111 0.0.0.0:* 1178/rpcbind UDP 0 0 0.0.0.0:631 0.0                               .0.0:* 1323/cupsd UDP 0 0 0.0.0.0:51485 0.0.0.0:*                               1196/RPC.STATD UDP 0 0 0.0.0.0:929 0.0.0.0:* 1178/rpcbind UDP 0 0 0.0.0.0:948 0.0.0.0:* 1196/          RPC.STATD UDP 0 0 0.0.0.0:67 0.0.0.0:* 4036/DHCPD      UDP 0 0 0.0.0.0:69 0.0.0.0:* 4058/xinetd UDP 0           0::: 111           :::* 1178/rpcbind UDP 0 0::: 929::: * 1178/rpcbind UDP 0 0::: 58086:::* # Serv Ice Cobblerd restart

Third, configuration Cobbler

The relationship between the main components of the cobbler is shown.


3.1 Management distro


The first step to make cobbler available is to define the distro, which can be implemented by specifying an external installation boot kernel and RAMDisk file for it. If you already have a complete system installation tree (such as an installation image of CentOS6), it is recommended that import be imported directly.


For example, for an installation image of a CentOS 6.5 x86_64 that has been mounted to the/media/directory, you can import it using a command similar to the following.


# mount-r/dev/cdrom/media# Cobbler Import--name= "centos6.5-x86_64"--path=/media/task started:2016-04-28_211028_ Importtask started (Id=media import, Time=thu Apr 21:10:28) Found A candidate signature:breed=redhat, Version=rhel 6Found a matching signature:breed=redhat, version=rhel6adding distros from path/var/www/cobbler/ks_mirror/ Centos6.5-x86_64:creating new distro:centos6.5-x86_64trying symlink:/var/www/cobbler/ks_mirror/centos6.5-x86_64- >/var/www/cobbler/links/centos6.5-x86_64creating new profile:centos6.5-x86_64associating reposchecking for rsync Repo (s) Checking for portal repo (s) Checking for Yum repo (s) starting descent into/var/www/cobbler/ks_mirror/centos6.5-x86_ Centos6.5-x86_64processing repo at:/var/www/cobbler/ks_mirror/centos6.5-x86_64need to process repo/comps:/var/ Www/cobbler/ks_mirror/centos6.5-x86_64looking for/var/www/cobbler/ks_mirror/centos6.5-x86_64/repodata/*comps*. Xmlkeeping repodata As-is:/var/www/cobbler/ks_mirror/centos6.5-x86_64/repodata*** TASK Complete * * * 




You can see the list of files by visiting: http://192.168.8.42/cobbler/


You can use "Cobbler distro list" to list all distro
# Cobbler Distro List
Centos6.5-x86_64


If you have a kickstart file, you can also use "--kickstart=/path/to/kickstart_file" to import, so import automatically generates a profile for the imported distro.


3.2 Managing Profiles


Cobbler uses profile to provide the required installation configuration for a specific requirement category, which is to generate a specific system installation configuration by providing kickstart files on distro basis. Distro profile can appear in the PXE boot menu as one of the options for installation.


Therefore, if you need to provide a bootable installation entry for the centos6.5-x86_64 created earlier, the kickstart file used is/root/anaconda-ks.cfg (only the most basic package is available), you can do so by the following command.


# CP anaconda-ks.cfg/var/lib/cobbler/kickstarts/
# cd/var/lib/cobbler/kickstarts/
# Vim Centos6.5-x86_64.cfg

# Kickstart file automatically generated by Anaconda. #version =develinstallurl--url= "Http://192.168.8.42/cobbler/ks_ mirror/centos6.5-x86_64/"Lang en_US. Utf-8keyboard usnetwork--onboot Yes--device eth0--bootproto dhcp--noipv6rootpw--iscrypted $6$zo9oj.qlqnykyr3a$omfni Npeobafrlems1hl/yb4qast3q4axtlof7zdqbszfmylg9clygobocfbsc11wggy/nlem8lisru.kqvsy0rebootfirewall-- Disabledauthconfig--enableshadow--passalgo=sha512selinux--disabledtimezone--utc Asia/Shanghaibootloader-- LOCATION=MBR--driveorder=sda--append= "Crashkernel=auto rhgb quiet" # The following is the partition information you Reque sted# Note that any partitions you deleted is not expressed# here so unless you clear all partitions first, this is# not Guaranteed to Workclearpart--allzerombrtextfirstboot--disablepart/boot--fstype=ext4--size=300part pv.008002--grow --size=61400volgroup vg_0--pesize=4096 pv.008002logvol/data--fstype=ext4--name=data--vgname=vg_0--size= 20000logvol/--FSTYPE=EXT4--name=root--vgnaMe=vg_0--size=20000logvol swap--name=swap--vgname=vg_0--size=4000logvol/usr/local--fstype=ext4--name=usr-- Vgname=vg_0--size=10000logvol/web--fstype=ext4--name=web--vgname=vg_0--size=25000% Packages@base@console-internet@core@debugging@directory-client@hardware-monitoring@java-platform@large-systems@network-fi Le-system-client@performance@perl-runtime@server-platform@server-policy@workstation-policypaxoddjobsgpiodevice-mapper-per Sistent-datasamba-winbindcertmongerpam_krb5krb5-workstationperl-dbd-sqlite%end



Directory/var/lib/cobbler/kickstarts/the location of the Kickstart configuration file as cobbler default
# Cobbler Profile Add--name=centos6.5-x86_64-basic--distro=centos6.5-x86_64--kickstart=/var/lib/cobbler/ Kickstarts/centos6.5-x86_64.cfg
View the profile you have created
# Cobbler Profile list   centos6.5-x86_64   centos6.5-x86_64-basic# Cobbler Sync


You can see what we've added by looking at the default file
# cat/var/lib/tftpboot/pxelinux.cfg/default Default menuprompt 0MENU TITLE Cobbler | Http://cobbler.github.ioTIMEOUT 200TOTALTIMEOUT 6000ONTIMEOUT Locallabel local        menu LABEL (local)        menu DEFAULT        localboot-1label centos6.5-x86_64        kernel/images/centos6.5-x86_64/vmlinuz        MENU LABEL centos6.5-x86_64        Append initrd=/images/centos6.5-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.8.42/cblr/svc/op/ks/profile/centos6.5-x86_64        ipappend 2LABEL centos6.5-x86_64-basic        Kernel/images/centos6.5-x86_64/vmlinuz        MENU LABEL centos6.5-x86_64-basic        append initrd=/images/centos6.5-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.8.42/cblr/svc/op/ks/profile/centos6.5-x86_64-basic        ipappend 2


Create a new virtual machine and start to see the system that is automatically recognized by the Cobbler




Added a custom release for development environment



Cobbler Delete distro

Command-line removal:

# Cobbler Distro Remove--name=centos6.7-x86_64
Exception on server: ' removal would orphan profile:centos6.7-x86_64 '

Delete directly from the web




The right way:

# Cobbler Profile Remove--name=centos6.7-x86_64
# Cobbler Distro Remove--name=centos6.7-x86_64


Iv. Configuring the use of Cobbler_web
4.1 Modifying the authentication type to Auth_pam
# Vim Modules.conf
[Authentication]
module = Authn_pam


4.2 Add Cobbler Web login user
# Useradd Cobbleruser
# echo ' Cobblerpass ' | passwd--stdin Cobbleruser


4.3 Edit users.conf file
# vim/etc/cobbler/users.conf


[Admins]
admin = "Cobbleruser"
Cobbler = ""

Visit: Http://192.168.8.42/cobbler_web



At this point, the installation and configuration of cobbler and common commands have been completed




CentOS 6.5 Automated Operation Koriyuki based on cobbler Service automated installation operating system detailed

Related Article

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.