Implementing multi-version operating system deployment based on cobbler

Source: Internet
Author: User
Tags rsync

Objective

in a production environment, when it is necessary to deploy dozens of or even hundreds of servers in bulk, it is particularly important to automate the installation of the operating system, which is unthinkable to boot the installation on a traditional CD-ROM, before we can simply automate the installation with Pxe+kickstart, but only for a single version of the installation , this approach is not flexible when you need to deploy different versions or different boot modes (BIOS, EFI). And cobbler is designed to solve this problem, this paper briefly introduces the installation configuration and use of cobbler.

Brief introduction

Cobbler is a free open source system installation deployment software for automating network installation of operating systems. Cobbler integrates DNS, DHCP, package updates, out-of-band management, and configuration management to facilitate OS installation automation. Cobbler can support PXE boot, OS reinstallation, and virtualization client creation, including Xen, KVM or VMware. Cobbler through the Koan program to support virtualized client installations. Cobbler can support the management of complex network environments, such as the bridging environment built on link aggregation Ethernet.

Cobbler Component Structure diagram

650) this.width=650; "Title=" Click to view the source page "style=" WIDTH:392PX;HEIGHT:289PX; "src=" http://www.ithov.com/uploads/allimg/ 130827/091321hx-0.png "alt=" 091321hx-0.png "height=" 289 "width=" 392 "/>

To install the configuration process:

① installing Cobbler, DHCP, rsync

② Configuration Cobbler

③ importing operating systems and Kickstart files to cobbler

④ Configuring the Yum Repository

⑤ Configuring DHCP, TFTP, HTTP

Installing Cobbler

#安装cobbler会把依赖的服务一并安装, such as Tftp-server, Httpd[[email protected] ~]# yum install cobbler[[email protected] ~]# yum-y install D HCP rsync# Set boot up [[email protected] ~]# chkconfig tftp on[[email protected] ~]# chkconfig rsync on

Configure Cobbler

[[email protected] ~]# service xinetd restart[[email protected] ~]#  Service cobblerd start[[email protected] ~]# cobbler checkthe following  are potential configuration items that you may want to fix :1 : the  ' Server '  field in /etc/cobbler/settings must be set  to something other than localhost, or kickstarting features will  not work.  this should be a resolvable hostname or ip  for the boot server as reachable by all machines that  will use it.2 : for pxe to be functional, the  ' Next_server '  field in /etc/cobbler/settings must be set to something other  than 127.0.0.1, and should match the ip of the boot server on the  pxe network.3 : some network boot-loaders are missing from /var/ lib/cobbler/loaders, you may run  ' Cobbler get-loaders '  to download  them, or, if you only want to handle x86/x86_64 netbooting,  You may ensure that you have installed a *recent* version of  the syslinux package installed and can ignore this message  entirely.  files in this directory, should you want to  Support all architectures, should include pxelinux.0, menu.c32, elilo.efi,  and yaboot. The  ' Cobbler get-loaders '  command is the easiest  way to rEsolve these requirements.4 : debmirror package is not installed,  it will be required to manage debian deployments and  repositories5 : ksvalidator was not found, install pykickstart6 :  the default password used by the sample templates for newly  installed machines  (default_password_crypted in /etc/cobbler/settings)  is  still set to  ' Cobbler '  and should be changed, try:  ' openssl  passwd -1 -salt  ' random-phrase-here '   ' your-password-here ' " to generate new  one7 : fencing tools were not found, and are required  to use the  (optional)  power management features. install cman or  fence-agents to use themrestart cobblerd and then run  ' Cobbler sync '  to apply  changes. #解决办法1,2:[[email protected] ~]# vim /etc/cobbler/settings server:  192.168.18.45next_server: 192.168.18.453:[[email protected] ~]# cobbler  GET-LOADERS4:5:[[email protected] ~]# yum -y install pykickstart6:[[email can be ignored  protected] ~]# openssl passwd -1 -salt 345223 123456$1$345223$/ Jb8mdzzy3srfwm5rbg3d. [[email protected] ~]# vim /etc/cobbler/settings default_password_crypted:  "$1$ 345223$/jb8mdzzy3srfwm5rbg3d. " 7: Can be ignored

Synchronize Cobbler configuration and check for errors

[[email protected] ~]# Cobbler Sync[[email protected] ~]# service cobblerd restart[[email protected] ~]# cobbler checkthe Following is potential configuration items if you could want to fix:1: Debmirror package was not installed, it would be re Quired to manage Debian deployments and repositories2:fencing tools were not found, and is required to use the (optiona L) power management features. Install Cman or fence-agents to use Themrestart cobblerd and then run ' Cobbler Sync ' to apply changes. #配置成功

Preparing the Kickstart file

[root[email protected] ~]# cp /var/lib/cobbler/ KICKSTARTS/SAMPLE_END.KS /VAR/LIB/COBBLER/KICKSTARTS/BASIC.KS 
[[Email protected] ~]# vim /var/lib/cobbler/kickstarts/basic.ks # kickstart  template for Fedora 8 and later.#  (includes %end blocks) #  do not use with earlier distros#platform=x86, amd64, or intel  em64t# system authorization informationauth  --useshadow  --enablemd5#  system bootloader configurationbootloader --location=mbr# partition clearing  informationclearpart --all --initlabel# Use text mode installtext#  Firewall configurationfirewall --disable# run the setup agent on first  bootfirstboot --disable# system keyboardkeyboard us# system languagelang  en_us# use network installationurl --url= $tree # if any cobbler  repo definitions were&Nbsp;referenced in the kickstart profile, include them here. $yum _repo_ Stanza# network information$snippet (' Network_config ') # reboot after  installationreboot#root passwordrootpw --iscrypted  $default _password_crypted   # MD5 encrypted cipher string, saved by default in/etc/cobbler/settings# selinux configurationselinux --disabled# do not  configure the X Window Systemskipx# System timezonetimezone   Asia/chongqing# install os instead of upgradeinstall# clear the master  boot recordzerombr# allow anaconda to partition the system as  neededpart pv.01 --grow --size=1             part /boot --fstype=ext4 --size=400part /boot/efi --fstype=efi  --size 200    #EFI模式需To create the partition Volgroup volgroup --pesize=4096 pv.01logvol / --fstype=ext4 --name=lv_root  --vgname=volgroup --grow --size=1024 --maxsize=51200logvol swap --name=lv_swap  --vgname=volgroup --grow --size=1984 --maxsize=4096%pre$snippet (' Log_ks_pre ') $SNIPPET (' Kickstart_start ') $SNIPPET (' Pre_install_network_config ') # enable installation monitoring$snippet (' Pre_anamon ')%end%packages@base@development@server-platform-develsamba-clientlftpopenssh-clientsepel-release# $SNIPPET (' func_install_if_enabled ')%end%post --nochroot$snippet (' Log_ks_post_nochroot ')%end%postecho  -e  "Alias net-pf-10 off\noptions ipv6 disable=1"  >/etc/modprobe.d/ ipv6.confecho  "Networking_ipv6=no"  >> /etc/sysconfig/networkchkconfig ip6tables  offcat >> /etc/security/limits.conf <<EOF*            soft    nproc           65535*            hard    nproc            65535*            soft    nofile           102400*           hard     nofile          204800eof$snippet (' Log_ks_post ') #  start yum configuration$yum_config_stanza# end yum configuration$snippet (' Post_ Install_kernel_options ') $SNIPPET (' Post_install_network_config ') $SNIPPET (' func_register_if_enabled ') $SNIPPET (' Download_config_files ') $SNIPPET (' Koan_environment ') $SNIPPET (' Redhat_register ') $SNIPPET (' Cobbler_register ') #  enable post-install  Boot notification$snippet (' Post_anamon ') # start final steps$snippet (' Kickstart_done ') #  end final steps%end

Import operating system to cobbler, add profile

[Email protected] ~]# mount/dev/sr0/mnt #挂载光驱 [[email protected] ~]# Cobbler import--name=centos-6.6-x86_64--path=/mn t #导入操作系统 [[email protected] ~]# ll/var/www/cobbler/ks_mirror/#验证一下是否导成功 [[email protected] ~]# Cobbler profile Add--na Me=centos-6.6-basic--distro=centos-6.6-x86_64--kickstart=/var/lib/cobbler/kickstarts/basic.ks[[email protected] ~]# Cobbler Profile list #验证一下 [[email protected] ~]# Cobbler sync #同步一下

Configure local yum warehouses and Epel warehouses

#配置本地yum仓库 [[email protected] ~]# mkdir/tmp/rpms[[email protected] ~]# Createrepo/tmp/rpms #放入rpm包, perform this step [email protect Ed] ~]# Cobbler Repo add--mirror=/tmp/rpms--name=local[[email protected] ~]# cobbler reposync# configuration Epel Warehouse [email protected ] ~]# cobbler Repo add--mirror=http://mirrors.aliyun.com/epel/6/x86_64/--name=epel[[email protected] ~]# Cobbler Reposync--tries=3--no-fail #同步epel仓库到本地, takes a long time # view added Repo[[email protected] ~]# cobbler Repo list Epel local# add repo To Profile[[email protected] ~]# Cobbler profile edit--name=centos-6.6-basic--repos= "Epel local" [[email protected] ~]# Co Bbler Sync

Configuring the DHCP server

[[email protected] ~]# vim /etc/dhcp/dhcpd.conf    #BIOS或EFI模式网络启动都能引导option  arch code 93 = unsigned integer 16; # rfc4578default-lease-time  600;max-lease-time 7200;log-facility local7;subnet 192.168.18.0 netmask  255.255.255.0 {    range 192.168.18.150 192.168.18.230;     option domain-name  "example.org";    option domain-name-servers  114.114.114.114,8.8.8.8;    option routers 192.168.18.1;           class  "Pxeclients"  {                   match if substring  (option  vendor-class-identifier, 0, 9)  =  "Pxeclient";                   next-server 192.168.18.45;                   if option arch =  00:06 {                           filename  "Grub/grub-x86.efi";                   }  else if option arch = 00:07 {                            filename  "Grub/grub-x86_64.efi";                   } else {                           filename  "pxelinux.0";                   }         }}

Restart Service

[[Email protected] ~]# service DHCPD restart[[email protected] ~]# service xinetd restart[[email protected] ~]# service HT TPD Restart[[email protected] ~]# service Cobblerd restart

Client Installation Test

EFI mode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/15/wKiom1XEfFiyc3rjAAGhbfztzSc353.jpg "title=" 122. PNG "alt=" wkiom1xeffiyc3rjaaghbfztzsc353.jpg "/>

BIOS mode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/15/wKiom1XEfK3RHaitAADaTS_sEJo317.jpg "title=" 123. PNG "alt=" wkiom1xefk3rhaitaadats_sejo317.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/15/wKiom1XEfXrzmp88AADsM6oWblw072.jpg "title=" 222. PNG "alt=" wkiom1xefxrzmp88aadsm6owblw072.jpg "/>

Client authentication, you can see that a repo file was generated, pointing to the Cobbler server

[Email protected] ~]# Cat/etc/yum.repos.d/cobbler-config.repo [core-0]name=core-0baseurl=http://192.168.18.45/ cobbler/ks_mirror/centos-6.6-x86_64enabled=1gpgcheck=0priority=1[local]name=localbaseurl=http://192.168.18.45/ Cobbler/repo_mirror/localenabled=1priority=99gpgcheck=0

At this point, the installation and configuration of cobbler are briefly introduced.

Can visit official website http://cobbler.github.io/Get help

This article is from the "Knowledge Base" blog, so be sure to keep this source http://liang178.blog.51cto.com/2137205/1682754

Implementing multi-version operating system deployment based on cobbler

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.