一、    批量配备操作系统的前提

要想批量布局操作系统,得具备以下规则:

客户机帮忙pxe互联网率领

劳务器端和客户端建立互联网通讯(DHCP)

劳务器端要有可供客户机开机率领的率领文件

劳务器端的可率领文件还必须能传递到客户机(TFTP)

客户机无人值守安装包罗安装定制的软件或服务(KICKSTAENVISIONT文件)

 

一、    批量布局操作系统的前提

要想批量配备操作系统,得具备以下原则:

客户机协理pxe互连网指点

劳务器端和客户端建立网络通讯(DHCP)

劳务器端要有可供客户机开机指引的引导文件

劳务器端的可指导文件还非得能传递到客户机(TFTP)

客户机无人值守安装包涵安装定制的软件或服务(KICKSTA凯雷德T文件)

 

批量布署操作系统之一,下cobbler安装及安顿。Cobbler(补鞋匠)是因此将DHCP、TFTP、DNS、HTTP等劳务拓展合并,创造一个中心管理节点,其可以落成的功用有配备服务,创立存储库,解压缩操作系统媒介,代理或合并一个安顿管理种类,控制电源管理等。
Cobbler的终极目标是贯彻无需进行人工干预即可安装机器。

1.背景介绍

用作运维,在商家日常遇上有些机械性重复工作要做,例如:为新机械装系统,一台两台机械装系统,可以用光盘、U盘等介质安装,1钟头也落成了,可是只要有成百台的服务器还要用光盘、U盘去安装,就突显略微不知所可了。PXE技术就能很好的缓解这几个难题,本文将会对PXE的工作规律有所介绍,而cobbler则是根据PXE技术的行事规律的二次封装,通过命令的艺术简化了PXE配置进程。

1.    认识一下PXE

预启动执行环境(Preboot eXecution
Environment,PXE,也被誉为预执行环境)提供了一种接纳网络接口(Network
Interface)启动电脑的机制。那种机制让电脑的开行可以不依靠地点数据存储设备(如硬盘)或当地已安装的操作系统

PXE:扶助工作站通过互连网从远端服务器下载印象,并通过帮衬通过网络启动操作系统,在起步进程中,终端要求服务器分配IP地址,再用TFTP(trivial
file transfer protocol)或MTFTP(multicasttrivial file transfer pro日

tocol)协议下载一个开行软件包到本机内存中执行,由那个启动软件包落成Client端自动化中央软件安装,从而指点预先安装在服务器中的终端操作系统。PXE可以率领七种操作系统,如:windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux等。

PXE是由速龙设计的协议,它可以使计算机通过网络启动。协议分成client和server两端,PXE
client在网卡的ROM中,当电脑率领时,BIOS把PXE
client调入内存执行,并显示出命令菜单,经用户挑选后,PXE
client将停放在远端的操作系统通过互联网下载到本地运行,无盘工作站就是通过PXE来开展启动的。PXE协议的中标运行需要缓解以下多个难点:IP地址的分配,下载Linux内核和根文件系统。

IP地址的分配

可以用DHCP server来给PXE client分配一个IP地址,DHCP Server是用来给DHCP
Client动态分配IP地址的合计,不过是因为此地是给PXE
Client分配IP地址,所以在计划DHCP Server时,须要追加对应的PXE特有陈设。

下载Linux内核和根文件系统

PXE client所在的ROM中,已经存在了TFTP Client。PXE Client使用TFTP
Client,通过TFTP协议到TFTP Server上下载所需的文件。

1.    认识一下PXE

预启动执行环境(Preboot eXecution
Environment,PXE,也被称呼预执行环境)提供了一种采纳网络接口(Network
Interface)启动电脑的建制。这种体制让电脑的启动可以不借助于地点数据存储设备(如硬盘)或本地已安装的操作系统

PXE:协助工作站通过互联网从远端服务器下载印象,并透过协助通过网络启动操作系统,在启动进程中,终端须求服务器分配IP地址,再用TFTP(trivial
file transfer protocol)或MTFTP(multicasttrivial file transfer pro日

tocol)协议下载一个开行软件包到本机内存中执行,由这一个启动软件包完毕Client端自动化主题软件安装,从而率领预先安装在服务器中的终端操作系统。PXE可以率领多样操作系统,如:windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux等。

PXE是由英特尔设计的磋商,它可以使总结机通过互联网启动。协议分成client和server两端,PXE
client在网卡的ROM中,当电脑指点时,BIOS把PXE
client调入内存执行,并出示出命令菜单,经用户接纳后,PXE
client将停放在远端的操作系统通过互连网下载到本地运行,无盘工作站就是通过PXE来进行启动的。PXE协议的中标运行要求缓解以下多个难点:IP地址的分配,下载Linux内核和根文件系统。

IP地址的分配

可以用DHCP server来给PXE client分配一个IP地址,DHCP Server是用来给DHCP
Client动态分配IP地址的情商,可是出于此处是给PXE
Client分配IP地址,所以在配备DHCP Server时,须要充实对应的PXE特有安插。

下载Linux内核和根文件系统

PXE client所在的ROM中,已经存在了TFTP Client。PXE Client使用TFTP
Client,通过TFTP协议到TFTP Server上下载所需的文件。

  pxe概述
  预启动执行环境(Preboot
eXecution
Environment,PXE,也被喻为预执行环境)是让电脑通过网卡独立地选拔数据设备(如硬盘)大概安装操作系统

2.PXE法则介绍

2.    PXE的工作规律

PXE client是内需设置操作系统的统计机,TFTP Server和DHCP
Server运行在此外一台Server上。Bootstrap文件、配置文件、Linux内核以及Linux根文件系统都停放在Linux
Server上TFTP服务器的根目录下。PXE
client在劳作经过中,须求七个二进制文件:bootstrap、Linux
内核和Linux根文件系统。Bootstrap文件是可执行程序,它向用户提供不难的主宰界面,并根据用户的精选,下载合适的Linux内核以及
Linux根文件系统。下图就是PXE工作的规律图:

澳门金沙国际 1

 

 

粗略统计一下:

PXE Client发送广播包请求DHCP分配IP地址DHCP

Server回复请求,给出IP地址以及Boot

PXE Client从Server下载教导文件执行指导程序

2.    PXE的劳作规律

PXE client是亟需设置操作系统的微处理器,TFTP Server和DHCP
Server运行在其余一台Server上。Bootstrap文件、配置文件、Linux内核以及Linux根文件系统都停放在Linux
Server上TFTP服务器的根目录下。PXE
client在做事进度中,须求三个二进制文件:bootstrap、Linux
内核和Linux根文件系统。Bootstrap文件是可执行程序,它向用户提供不难的操纵界面,并基于用户的选取,下载合适的Linux内核以及
Linux根文件系统。下图就是PXE工作的法则图:

澳门金沙国际 2

 

 

不难计算一下:

PXE Client发送广播包请求DHCP分配IP地址DHCP

Server回复请求,给出IP地址以及Boot

PXE Client从Server下载指导文件执行指点程序

    PXE Client发送广播包请求DHCP分配IP地址DHCP
    Server回复请求,给出IP地址以及Boot
    Server的地址PXE下载率领文件执行指导程序

2.1规律与概念

骨子里把PXE称作是一种指点格局而不是安装格局就好像越来越规范,PXE(Pre-boot
Execution
Environment)是由AMD设计的商事,它能够使总结机通过网络启动,然而有一个前提条件是电脑的网卡必须有所指点效应,那些网卡中要有一个PXE客户端。当电脑POST自检成功之后,BIOS把网卡中ROM的PXE客户端调入内存执行,PXE客户端通过互联网中的DHCP服务器获取一个IP地址,得到IP地址然后PXE继续指点统计机与互联网中的TFTP客户端建立连接,从而从TFTP服务器中获取开机辅导文件之后请求并下载安装须求的文本。在那些历程中须要一台服务器来提供启动文件、安装文件、以及安装进程中的自动回复文件等。

3.    PXE应用

PXE最直白的显现是,在网络环境下工作站可以省去硬盘,但又不是平日所说的无盘站的概念,因为使用该技术的PC在网络形式下的运行速度要比有盘PC快3倍以上。当然使用PXE的PC也不是古板意义上的TE奔驰M级MINAL终端,因为使用了PXE的PC并不消耗服务器的CPU,RAM等资源,故服务器的硬件要求极低。

网络克隆 PXE
以后最好普遍的使用一个是网吧的无盘技术。在有盘领域的互连网维护和安装中PXE可以是最好用的网吧系统集合设置和护卫的辅导技术,PXE的指导速度和稳定都以头号的!

3.    PXE应用

PXE最直白的显示是,在互连网环境下工作站可以省去硬盘,但又不是惯常所说的无盘站的定义,因为运用该技能的PC在网络格局下的运转速度要比有盘PC快3倍以上。当然使用PXE的PC也不是传统意义上的TE奥迪Q3MINAL终端,因为使用了PXE的PC并不消耗服务器的CPU,RAM等资源,故服务器的硬件须求极低。

互连网克隆 PXE
以后极其广泛的接纳一个是网吧的无盘技术。在有盘领域的网络维护和设置中PXE可以是最好用的网吧系统集合安装和保障的指导技术,PXE的带领速度和平稳都以世界级的!

总计来说,

2.2PXE行事步骤如下图:

澳门金沙国际 3

规律介绍

  • Client向PXE
    Server上的DHCP发送IP地址请求音信,DHCP检测Client是还是不是合法(主借使检测Client的网卡MAC地址),借使官方则赶回Client的IP地址,同时将启动文件pxelinux.0的岗位音信一并传递给Client
  • Client向PXE
    Server上的TFTP发送获取pxelinux.0请求音讯,TFTP接收到新闻随后再向Client发送pxelinux.0大小消息,试探Client是还是不是满足,当TFTP收到Client发回的同意大小音信之后,正式向Client发送pxelinux.0
  • Client执行接收到的pxelinux.0文件
  • Client向TFTP
    Server发送针对本机的布局新闻文件(在TFTP服务的pxelinux.cfg目录下,那是系统菜单文件,格式和isolinux.cfg格式一样,成效也是近似),TFTP将安插文件发回Client,继而Client依照布置文件实行后续操作。
  • Client向TFTP发送Linux内核请求信息,TFTP接收到新闻随后将基本文件发送给Client
  • Client向TFTP发送根文件请求消息,TFTP接收到新闻随后重返Linux根文件系统
  • Client启动Linux内核
  • Client下载安装源文件,读取自动化安装脚本

4.    什么是Kickstart

官方文档:

KickStart是一种无人职守安装格局,是由redhat集团为了化解无人值守安装操作系统而规划的。系统管理员通过制造一个单纯的kickstart配置文件就足以兑现自动化安装操作系统。KickStart的劳作规律是通过记录典型的设置进程中所需人工干预填写的各个参数,并转移一个名为ks.cfg的公文;在以后的设置进度中(不只局限于生成KickStart安装文件的机械)当现身须求填写参数的情景时,安装程序会率先去查找KickStart生成的公文,当找到适当的参数时,就应用找到的参数,当没有找到合适的参数时,才须要安装者手工干预。那样,即使KickStart文件涵盖了安装进度中现身的富有需求填写的参数时,安装者完全可以只告诉安装程序从何方取ks.cfg文件,然后去忙自个儿的事情。等装置完结,安装程序会依据ks.cfg中安装的重启选项来重启系统,并停止安装。

 

4.    什么是Kickstart

合法文档:

KickStart是一种无人职守安装格局,是由redhat集团为了缓解无人值守安装操作系统而陈设的。系统管理员通过创建一个纯净的kickstart配置文件就可以兑现自动化安装操作系统。KickStart的工作规律是透过记录典型的装置进度中所需人工干预填写的各样参数,并扭转一个名为ks.cfg的文书;在随后的装置进程中(不只局限于生成KickStart安装文件的机器)当出现须求填写参数的情状时,安装程序会首先去查找KickStart生成的文本,当找到确切的参数时,就选取找到的参数,当没有找到适合的参数时,才必要安装者手工干预。那样,假若KickStart文件涵盖了设置进程中冒出的有所须求填写的参数时,安装者完全可以只报告安装程序从何地取ks.cfg文件,然后去忙自身的作业。等设置收尾,安装程序会依照ks.cfg中安装的重启选项来重启系统,并终止安装。

 

  pxe客户端会调用网际协议(ip)、用户数据报协议(udp)、动态主机设定协议(DHCP)、小型文件传输协议(TFTP)

3.Cobbler

鉴于pxe自动装系统网上一搜一大把,作者就不详细操作举例了,昨天根本讲一讲Cobbler。

二. Cobbler介绍

二. Cobbler介绍

  pxe客户端(client)指机器在pxe启动进度中的剧中人物。一个pxe客户端可以是一台服务器、台式机电脑大概此外装有pxe启动代码的机械

3.1Cobbler介绍

Cobbler是一个Linux服务器神速网络安装的劳务,由python开发,小巧轻便(15k行python代码),可以透过PXE的法门来飞速安装、重装物理服务器和虚拟机,同时还能管理DHCP,DNS,TFTP、途观SYNC以及yum仓库、构造系统ISO镜像。

Cobbler可以动用命令行格局管理,也提供了依据Web的界面管理工具(cobbler-web),还提供了API接口,可以一本万利二次开发使用。

1.    什么是Cobbler

官方网站:

GITHUB:

Cobbler是一个迅速网络安装linux的劳务,而且在通过调整也可以支撑网络安装windows。该工具使用python开发,小巧轻便(才15k行代码),使用简单的授命即可已毕PXE网络安装环境的配备,同时还足以管理DHCP,DNS,以及yum包镜像。

Cobbler是一个应用程序,可以大量的安插操作系统,可以同时安顿七个差其余操作系统,协作kickstart文件可以定制和无人值守的点子布置操作系统。它对PXE进行二次开发和包裹,同时提供二次开发接口。

Cobbler
的配置结构基于一组注册的目标。各种对象表示一个与另一个实体相关联的实体(该对象指向另一个目标,或然另一个目标指向该对象)。当一个对象指向另一个目的时,它就卫冕了被针对对象的数目,并可覆盖或添加更加多特定音信。以下目的类型的定义为:

澳门金沙国际 4

 

发行版(Distro):

代表一个操作系统。它承前启后了基本和 initrd 的信息,以及基本参数等其他数据。

计划文件(Profile):

带有一个发行版、一个 kickstart
文件以及可能的存储库,还含有越多特定的基业参数等其他数据。

系统(System):

意味着要配给的机器。它涵盖一个布局文件或一个镜像,还带有 IP 和 MAC
地址、电源管理(地址、凭据、类型)以及特别规范的多少等音信。

存储库(Repo):

保存一个 yum 或 rsync 存储库的镜像音讯。

镜像(Image):

可替换一个暗含不属于此类其他公文的发行版对象(例如,不能分为基础和
initrd 的对象)。

依据注册的目的以及各种对象之间的关联,Cobbler
知道什么改变文件系统以显示实际安排。因为系统布局的内部是空虚的,所以你可以仅关切想要执行的操作。

 

1.    什么是Cobbler

官方网站:

GITHUB:

Cobbler是一个高效网络安装linux的劳动,而且在通过调整也得以支撑互连网安装windows。该工具使用python开发,小巧轻便(才15k行代码),使用简易的通令即可形成PXE互联网安装环境的安顿,同时还足以管理DHCP,DNS,以及yum包镜像。

Cobbler是一个应用程序,可以多量的配置操作系统,可以同时安顿五个不等的操作系统,协作kickstart文件可以定制和无人值守的法子安排操作系统。它对PXE进行二次开发和包装,同时提供二次开发接口。

Cobbler
的布局结构基于一组注册的靶子。各种对象表示一个与另一个实体相关联的实业(该对象指向另一个对象,或许另一个目的指向该目的)。当一个对象指向另一个目标时,它就一连了被针对对象的数量,并可覆盖或添加越来越多特定音讯。以下目的类型的定义为:

澳门金沙国际 5

 

发行版(Distro):

意味着一个操作系统。它承载了基本和 initrd 的消息,以及基本参数等其它数据。

布署文件(Profile):

饱含一个发行版、一个 kickstart
文件以及只怕的存储库,还包括越多特定的内核参数等其他数据。

系统(System):

表示要配给的机械。它包蕴一个配备文件或一个镜像,还包蕴 IP 和 MAC
地址、电源管理(地址、凭据、类型)以及进一步规范的数码等音信。

存储库(Repo):

封存一个 yum 或 rsync 存储库的镜像消息。

镜像(Image):

可替换一个带有不属于此类其他文本的发行版对象(例如,无法分为基础和
initrd 的目标)。

据悉注册的靶子以及各种对象时期的涉及,Cobbler
知道怎样转移文件系统以显示实际配置。因为系统安顿的内部是用空想来欺骗别人的,所以你可以仅关注想要执行的操作。

 

  PXE紧假设通过播放的章程发送一个包,并请注获取一个地方,而后交给TFTP程序下载一个率领文件。

3.2Cobbler工作流程

 澳门金沙国际 6

  • client裸机配置了从网络启动后,开机后会广播包请求DHCP服务器 (cobbler
    server)发送其分配好的一个IP
  • DHCP服务器(cobbler server)收到请求后发送responese,包括其ip地址
  • client裸机得到ip后再向cobbler server发送请求OS指导文件的央求
  • cobbler server告诉裸机OS带领文件的名字和TFTP server的ip和 port
  • client裸机通过下边告知的TFTP server地址通讯,下载指导文件
  • client裸机执行实施该指引文件,确定加载音讯,拔取要设置的os,
    期间会再向cobbler server请求kickstart文件和os image
  • cobbler server发送请求的kickstart和os iamge
  • client裸机加载kickstart文件
  • client裸机接收os image,安装该os image

2.   Cobbler原理

Cobbler由Python语言开发,是对PXE和Kickstart以及DHCP的包装。融合很多性子,提供了CLI和Web的管理格局。尤其便民的履行互联网安装。同时,Cobbler也提供了API接口,使用任何语言也很不难做扩充。它不紧可以设置物理机,同时也支撑kvm、xen虚拟化、Guest
OS的设置。越来越多的是它仍是可以结成Puppet等集中化管理软件,完成自动化的管理。

Cobbler 援救广大的发行版:Red Hat、Fedora、CentOS、Debian、Ubuntu 和
SuSE。当添加一个操作系统(常常经过动用 ISO 文件)时,Cobbler
知道如何解压缩合适的公文并调整互连网服务,以正确指引机器。Cobbler
使用命令行格局管理,也提供了基于Web的图形化配置管理工具(cobbler-web)。通过安排cobbler自动陈设DHCP、TFTP、HTTP,在装置过程中加载kiskstart无人值守安装应答文件贯彻无人值守。从客户端接纳PXE教导启动安装。

 澳门金沙国际 7

 

Server端

第一步,启动Cobbler服务

其次步,举办Cobbler错误检查,执行cobbler check命令

其三步,举行安顿同步,执行cobbler sync命令

第四步,复制相关启动文件文件到TFTP目录中

第五步,启动DHCP服务,提供地点分配

第六步,DHCP服务分配IP地址

第七步,TFTP传输启动文件

第八步,Server端接收装置信息

第九步,Server端发送ISO镜像与Kickstart文件

Client端

首先步,客户端以PXE格局启动

第二步,客户端获取IP地址

其三步,通过TFTP服务器获取启动文件

第四步,进入Cobbler安装拔取界面

第五步,客户端确定加载音信

第六步,依照安插消息准备安装系统

第七步,加载Kickstart文件

第八步,传输种类设置的其余文件

第九步,进行安装系统

2.   Cobbler原理

Cobbler由Python语言开发,是对PXE和Kickstart以及DHCP的卷入。融合很多特色,提供了CLI和Web的管住形式。尤其有利于的施行互联网安装。同时,Cobbler也提供了API接口,使用其他语言也很不难做扩大。它不紧可以安装物理机,同时也协助kvm、xen虚拟化、Guest
OS的安装。更加多的是它仍是可以整合Puppet等集中化管理软件,达成自动化的田间管理。

Cobbler 帮衬广大的发行版:Red Hat、Fedora、CentOS、Debian、Ubuntu 和
SuSE。当添加一个操作系统(平时经过选拔 ISO 文件)时,Cobbler
知道怎么解压缩合适的文件并调整网络服务,以正确指点机器。Cobbler
使用命令行形式管理,也提供了依照Web的图形化配置管理工具(cobbler-web)。通过配备cobbler自动计划DHCP、TFTP、HTTP,在设置进程中加载kiskstart无人值守安装应答文件落到实处无人值守。从客户端应用PXE率领启动安装。

 澳门金沙国际 8

 

Server端

第一步,启动Cobbler服务

其次步,进行Cobbler错误检查,执行cobbler check命令

其三步,进行布置同步,执行cobbler sync命令

第四步,复制相关启动文件文件到TFTP目录中

第五步,启动DHCP服务,提供位置分配

第六步,DHCP服务分配IP地址

第七步,TFTP传输启动文件

第八步,Server端接收装置音讯

第九步,Server端发送ISO镜像与Kickstart文件

Client端

率先步,客户端以PXE情势启动

其次步,客户端获取IP地址

其三步,通过TFTP服务器获取启动文件

第四步,进入Cobbler安装选用界面

第五步,客户端确定加载信息

第六步,按照计划消息准备安装系统

第七步,加载Kickstart文件

第八步,传输系统安装的其余文件

第九步,进行安装系统

cobbler和Kickstart批量装机软件

3.3Cobbler集成的劳务

  • PXE服务支撑
  • DHCP服务管理
  • DNS服务管理(可选bind,dnsmasq)
  • 电源管理
  • Kickstart服务支撑
  • YUM仓库管理
  • TFTP(PXE启动时需求)
  • Apache(提供kickstart的安装源,并提供定制化的kickstart配置)

三、    Cobbler安装与起头配置

三、    Cobbler安装与先河配置

 Cobbler由python语言开发,是对PXE和Kickstart以及DHCP的卷入。融合很多表征,提供了CLI和Web的治本格局。越发有益的实践网络安装。同时,Cobbler也提供了API接口,使用其余语言也很不难做增添。它不紧可以安装物理机,同时也支撑kvm、xen虚拟化、Guest
OS的设置。更加多的是它仍是可以结成Puppet等集中化管理软件,完成自动化的治本。

3.4配备目录

安顿文件目录:
/etc/cobbler
/etc/cobbler/settings : cobbler 主配置文件
/etc/cobbler/iso/: iso模板配置文件
/etc/cobbler/pxe: pxe模板文件
/etc/cobbler/power: 电源配置文件
/etc/cobbler/user.conf: web服务授权配置文件
/etc/cobbler/users.digest: web访问的用户名密码配置文件
/etc/cobbler/dhcp.template : dhcp服务器的的安顿末班
/etc/cobbler/dnsmasq.template : dns服务器的配备模板
/etc/cobbler/tftpd.template : tftp服务的布署模板
/etc/cobbler/modules.conf : 模块的布署文件
数量目录:
/var/lib/cobbler/config/: 用于存放distros,system,profiles 等信息配置文件
/var/lib/cobbler/triggers/: 用于存放用户定义的cobbler命令
/var/lib/cobbler/kickstart/: 专擅认同存放kickstart文件
/var/lib/cobbler/loaders/: 存放种种指导程序  镜像目录
/var/www/cobbler/ks_mirror/: 导入的发行版系统的享有数据
/var/www/cobbler : 导入发行版的kernel和initrd镜像用于
远程互连网启动
/var/www/cobbler/repo_mirror/: yum 仓库存储目录
日志目录:
/var/log/cobbler/installing: 客户端安装日志
/var/log/cobbler/cobbler.log : cobbler日志

1.    添加EPEL源

Cobbler位于EPEL源中,若是系统并未EPEL源,先要安装

# yum -y install epel-release

1.    添加EPEL源

Cobbler位于EPEL源中,假使系统尚未EPEL源,先要安装

# yum -y install epel-release

  Kickstart
是一种无人值守的装置形式,它的干活原理是在安装进度中记录人工干预填写的各个参数,并转移一个名为ks.cfg的文本。大家可以简简单单明了为一个机关安装应答配置管理程序。通过读取这几个布局文件,系统领悟怎么去分区,要安装什么包,配什么IP,优化什么内核参数等等 

3.5发令介绍

cobbler commands介绍
cobbler check 核查当前安装是还是不是有难题
cobbler list 列出具有的cobbler成分
cobbler report 列出成分的详细音讯
cobbler sync 同步布置到数码目录,更改配置最好都要举办下
cobbler reposync 同步yum仓库
cobbler distro 查看导入的发行版系统新闻
cobbler system 查看添加的种类消息
cobbler profile 查看配置新闻

2.    Cobbler支撑服务安装

Cobbler即使能够接管DHCP服务,但本身并不提供DHCP服务,而且yum安装
cobbler的时候也不会自行安装DHCP,不过会安装TFTP,HTTP及一些python的包。

# yum -y install dhcp

2.    Cobbler支撑服务安装

Cobbler即便可以接管DHCP服务,但自作者并不提供DHCP服务,而且yum安装
cobbler的时候也不会自动安装DHCP,但是会安装TFTP,HTTP及一些python的包。

# yum -y install dhcp

 
一句话计算:Cobbler补鞋匠是对Kickstart的卷入,简化安装步骤、使用流程,官方称为补鞋匠都能学会的批量装机。

3.6/etc/cobbler/settings中至关紧要的参数设置

default_password_crypted: “$1$gEc7ilpP$pg5iSOj/mlxTxEslhRvyp/”
manage_dhcp:1
manage_tftpd:1
pxe_just_once:1
next_server:< tftp服务器的 IP 地址>
server:

3.    Yum安装cobbler

# yum -y install cobbler

上面是安装完后系统中一些生死攸关的公文地点及注解:

 #rpm -ql cobbler

/etc/cobbler

配置文件目录

/etc/cobbler/settings

cobbler主配置文件

/etc/cobbler/dhcp.template

DHCP服务的配置模板

/etc/cobbler/tftpd.template

tftp服务的配置模板

/etc/cobbler/rsync.template

rsync服务的配置模板

/etc/cobbler/iso

iso模板配置文件目录

/etc/cobbler/pxe

pxe模板文件目录

/etc/cobbler/power

电源的配置文件目录

/etc/cobbler/users.conf

Web服务授权配置文件

/etc/cobbler/users.digest

web访问的用户名密码配置文件

/etc/cobbler/dnsmasq.template

DNS服务的配置模板

/etc/cobbler/modules.conf

Cobbler模块配置文件

/var/lib/cobbler

Cobbler数据目录

/var/lib/cobbler/config

配置文件

/var/lib/cobbler/kickstarts

默认存放kickstart文件

/var/lib/cobbler/loaders

存放的各种引导程序

/var/www/cobbler

系统安装镜像目录

/var/www/cobbler/ks_mirror

导入的系统镜像列表

/var/www/cobbler/images

导入的系统镜像启动文件

/var/www/cobbler/repo_mirror

yum源存储目录

/var/log/cobbler

日志目录

/var/log/cobbler/install.log

客户端系统安装日志

/var/log/cobbler/cobbler.log

cobbler日志

 

3.    Yum安装cobbler

# yum -y install cobbler

下边是安装完后系统中一些重中之重的公文地方及评释:

 #rpm -ql cobbler

/etc/cobbler

配置文件目录

/etc/cobbler/settings

cobbler主配置文件

/etc/cobbler/dhcp.template

DHCP服务的配置模板

/etc/cobbler/tftpd.template

tftp服务的配置模板

/etc/cobbler/rsync.template

rsync服务的配置模板

/etc/cobbler/iso

iso模板配置文件目录

/etc/cobbler/pxe

pxe模板文件目录

/etc/cobbler/power

电源的配置文件目录

/etc/cobbler/users.conf

Web服务授权配置文件

/etc/cobbler/users.digest

web访问的用户名密码配置文件

/etc/cobbler/dnsmasq.template

DNS服务的配置模板

/etc/cobbler/modules.conf

Cobbler模块配置文件

/var/lib/cobbler

Cobbler数据目录

/var/lib/cobbler/config

配置文件

/var/lib/cobbler/kickstarts

默认存放kickstart文件

/var/lib/cobbler/loaders

存放的各种引导程序

/var/www/cobbler

系统安装镜像目录

/var/www/cobbler/ks_mirror

导入的系统镜像列表

/var/www/cobbler/images

导入的系统镜像启动文件

/var/www/cobbler/repo_mirror

yum源存储目录

/var/log/cobbler

日志目录

/var/log/cobbler/install.log

客户端系统安装日志

/var/log/cobbler/cobbler.log

cobbler日志

 

Cobbler
工作流程

4.Cobbler安装

4.    Cobbler发轫配置cobbler check

将cobbler所看重的劳务设置为开机自启动,并开启服务,首要有httpd,dhcpd,tftp及cobbler本人。

#systemctl start httpd

#systemctl enable httpd

#systemctl start tftp

#systemctl enable tftp

#systemctl start dhcpd

#systemctl enable dhcpd

# systemctl start cobbler

# systemctl enable cobbler

Cobbler
check命令重如若用来检查当前系统是或不是餍足cobbler的运转须求,上面是第三遍运行cobbler
check命令的晋升,按照提醒一个一个修改即可。

# cobbler check

The 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 : SELinux is enabled. Please review the following wiki page for
details on ensuring cobbler works correctly in your SELinux environment:

   

4 : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp

5 : 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.

6 : enable and start rsyncd.service with systemctl

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

8 : ksvalidator was not found, install pykickstart

9 : 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:default_password_crypted “openssl passwd -1 -salt
‘random-phrase-here’ ‘your-password-here'” to generate new one

10 : fencing tools were not found, and are required to use the
(optional) power management features. install cman or fence-agents to
use them

Restart cobblerd and then run ‘cobbler sync’ to apply changes.

1#其一提醒是急需修改/etc/cobbler/settings 文件中server:
后边的IP地址,那几个地方默许是127.0.0.1亟待修改成能够通讯的cobbler服务器本机真实的网卡地址。

#vi /etc/cobbler/settings

server: 192.168.100.10

2#本条指示是说要想让PXE工作起来,须求设置/etc/cobbler/settings中next_server的ip地址,若是启用cobbler来保管DHCP就要修改,那几个是dhcp服务器的地址,如若没有正确安装这些地点则会突显TFTP超时。

#vi /etc/cobbler/settings

next_server: 192.168.100.10

3#其一提示需求关门selinux

#vi /etc/sysconfig/selinux

SELINUX=disabled

4#指示须求启用tftp

#vi /etc/xinetd.d/tftp

service tftp

{

       socket_type           = dgram

       protocol         = udp

       wait               = yes

       user               = root

       server                   = /usr/sbin/in.tftpd

       server_args           = -s /var/lib/tftpboot

       disable                  = no

       per_source            = 11

       cps                = 100 2

       flags                     = IPv4

5#提示须求选取cobbler get-loaders从网上下载指导程序

# cobbler get-loaders

6#提醒必要启动 rsyncd服务

# systemctl start rsyncd

7#提示deb的包没有被设置,如若不打算陈设debian系统可以忽略

8#提示须求安装pykickstart

#yum –y pykickstart

9#指示须要修改专断认同密码”openssl passwd -1 -salt ‘random-phrase-here’
‘your-password-here'”并替换settings中default_password_crypted引号中的内容

# openssl passwd -1 -salt ‘frank’ ‘frank’

$1$frank$.XItdMFNYz07ISKS9q9Jx0

#vi /etc/cobbler/settings

default_password_crypted: “$1$frank$.XItdMFNYz07ISKS9q9Jx0”

10#唤醒假诺使用电源管理模块,必要设置cman 大概 fence-agents

# yum install fence-agents-all

4.    Cobbler开端配置cobbler check

将cobbler所正视的劳务设置为开机自启动,并打开服务,首要有httpd,dhcpd,tftp及cobbler本身。

#systemctl start httpd

#systemctl enable httpd

#systemctl start tftp

#systemctl enable tftp

#systemctl start dhcpd

#systemctl enable dhcpd

# systemctl start cobbler

# systemctl enable cobbler

Cobbler
check命令重倘若用来检查当前系统是还是不是满意cobbler的周转须要,下边是首先次运行cobbler
check命令的唤醒,根据提醒一个一个修改即可。

# cobbler check

The 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 : SELinux is enabled. Please review the following wiki page for
details on ensuring cobbler works correctly in your SELinux environment:

   

4 : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp

5 : 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.

6 : enable and start rsyncd.service with systemctl

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

8 : ksvalidator was not found, install pykickstart

9 : 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:default_password_crypted “openssl passwd -1 -salt
‘random-phrase-here’ ‘your-password-here'” to generate new one

10 : fencing tools were not found, and are required to use the
(optional) power management features. install cman or fence-agents to
use them

Restart cobblerd and then run ‘cobbler sync’ to apply changes.

1#其一指示是内需修改/etc/cobbler/settings 文件中server:
前边的IP地址,那几个地址暗中认同是127.0.0.1索要修改成可以通讯的cobbler服务器本机真实的网卡地址。

#vi /etc/cobbler/settings

server: 192.168.100.10

2#本条指示是说要想让PXE工作起来,须要设置/etc/cobbler/settings中next_server的ip地址,假使启用cobbler来管理DHCP就要修改,那一个是dhcp服务器的地方,若是没有正确安装那么些地方则会呈现TFTP超时。

#vi /etc/cobbler/settings

next_server: 192.168.100.10

3#其一指示要求关门selinux

#vi /etc/sysconfig/selinux

SELINUX=disabled

4#指示须要启用tftp

#vi /etc/xinetd.d/tftp

service tftp

{

       socket_type           = dgram

       protocol         = udp

       wait               = yes

       user               = root

       server                   = /usr/sbin/in.tftpd

       server_args           = -s /var/lib/tftpboot

       disable                  = no

       per_source            = 11

       cps                = 100 2

       flags                     = IPv4

5#指示须要采纳cobbler get-loaders从网上下载指引程序

# cobbler get-loaders

6#指示须要启动 rsyncd服务

# systemctl start rsyncd

7#指示deb的包没有被安装,假如不打算布置debian系统可以忽略

8#提醒必要安装pykickstart

#yum –y pykickstart

9#提醒必要修改暗中认同密码”openssl passwd -1 -salt ‘random-phrase-here’
‘your-password-here'”并替换settings中default_password_crypted引号中的内容

# openssl passwd -1 -salt ‘frank’ ‘frank’

$1$frank$.XItdMFNYz07ISKS9q9Jx0

#vi /etc/cobbler/settings

default_password_crypted: “$1$frank$.XItdMFNYz07ISKS9q9Jx0”

10#唤醒假若运用电源管理模块,必要设置cman 大概 fence-agents

# yum install fence-agents-all

server端:

4.1种类新闻

 1 [root@localhost ~]#  cat /etc/redhat-release 
 2 CentOS Linux release 7.2.1511 (Core) 
 3 [root@localhost ~]#  uname -r
 4 3.10.0-327.el7.x86_64
 5 [root@localhost ~]#  getenforce 
 6 Disabled
 7 [root@localhost ~]#  systemctl status firewalld.service 
 8 ● firewalld.service - firewalld - dynamic firewall daemon
 9    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
10    Active: inactive (dead)
11      Docs: man:firewalld(1)
12 [root@localhost ~]#  ifconfig eno16777736|awk -F "[ :]+" 'NR==2 {print $3}'
13 10.0.0.101
14 [root@localhost ~]#  hostname
15 localhost.localdomain
16 [root@localhost ~]#  

如上步骤全部实施到位后,重启cobbler服务,并接纳cobbler sync保存修改,也可以每修改一个唤起执行一下。直到没有指示,或能够忽略某些指示为止。

#systemc restart cobblerd

#cobbler sync

#cobbler check

The following are potential configuration items that you may want to
fix:

1 : 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.

OK,至此关于批量设置的底蕴部分及cobbler介绍就到此地,下一篇将介绍下cobbler的下令及实战。

如上步骤全部实践到位后,重启cobbler服务,并使用cobbler sync保存修改,也得以每修改一个提示执行一下。直到没有提示,或能够忽略某些提醒截至。

#systemc restart cobblerd

#cobbler sync

#cobbler check

The following are potential configuration items that you may want to
fix:

1 : 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.

OK,至此关于批量安装的基本功部分及cobbler介绍就到此处,下一篇将介绍下cobbler的一声令下及实战。

    第一步,启动Cobbler服务
    第二步,进行Cobbler错误检查,执行cobbler check命令
    第三步,进行安顿同步,执行cobbler sync命令
    第四步,复制相关启动文件文件到TFTP目录中
    第五步,启动DHCP服务,提供地点分配
    第六步,DHCP服务分配IP地址
    第七步,TFTP传输启动文件
    第八步,Server端接收装置信息
    第九步,Server端发送ISO镜像与Kickstart文件

4.2配置yum源

[root@localhost ~]## rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm

[root@localhost ~]## yum makecache

Client端:

4.3上马设置Cobbler

    第一步,客户端以PXE形式启动
    第二步,客户端获取IP地址
    第三步,通过TFTP服务器获取启动文件
    第四步,进入Cobbler安装接纳界面
    第五步,客户端确定加载音信
    第六步,依据配置音讯准备安装系统
    第七步,加载Kickstart文件
    第八步,传输系统设置的任何文件
    第九步,举办设置系统

4.3.1设置cobbler以及有关的软件

[root@localhost ~]# yum -y install httpd dhcp tftp python-ctypes cobbler  xinetd cobbler-web

专业环境准备:

4.3.2起首相关服务

[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# systemct1 enable cobblerd
[root@localhost ~]# systemctl start cobblerd

 
1.互联网环境:host-only、nat互联网,因为Cobbler需要用到温馨的dhcp服务器,所以为了以免都在同一个网络造成dhcp获取混乱,必要切换互连网!~ 

4.3.3透过cobbler check 核对当前安装是还是不是有难点

 1 [root@localhost ~]# cobbler check
 2 The following are potential configuration items that you may want to fix:
 3 
 4 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.
 5 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.
 6 3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
 7 4 : 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.
 8 5 : enable and start rsyncd.service with systemctl
 9 6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
10 7 : 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 one
11 8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
12 
13 Restart cobblerd and then run 'cobbler sync' to apply changes.

坚守指示一个一个的缓解难题:

问题1:

[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 10.0.0.101/' /etc/cobbler/settings  # 修改server的ip地址为本机ip

问题2:

[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 10.0.0.101/' /etc/cobbler/settings # TFTP Server 的IP地址

问题3:

 1 service tftp
 2 {
 3         socket_type             = dgram
 4         protocol                = udp
 5         wait                    = yes
 6         user                    = root
 7         server                  = /usr/sbin/in.tftpd
 8         server_args             = -s /var/lib/tftpboot
 9         disable                 = no  # 修改为no
10         per_source              = 11
11         cps                     = 100 2
12         flags                   = IPv4
13 }

问题4:

[root@localhost ~]# cobbler get-loaders  # 下载缺失的文件
task started: 2017-10-15_113824_get_loaders
task started (id=Download Bootloader Content, time=Sun Oct 15 11:38:24 2017)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***

问题5:

# 添加rsync到自启动并启动rsync
[root@localhost ~]# systemctl enable rsyncd 
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@localhost ~]# systemctl start rsyncd 

 问题6:

跟debian 相关,可以忽略

问题7:

# 修改密码为123456 ,salt后面是常用的加盐方式加密
[root@localhost ~]# openssl passwd -1 -salt '123456' '123456' 
$1$123456$wOSEtcyiP2N/IfIl15W6Z0
[root@localhost ~]# vim /etc/cobbler/settings # 修改settings配置文件中下面位置,把新生成的密码加进去
default_password_crypted: "$1$123456$wOSEtcyiP2N/IfIl15W6Z0

重新实施cobbler check

[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : debmirror package is not installed, it will be required to manage debian deployments and repositories # debian相关
2 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them # fence设备相关,不需要

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

如上多个难点暂时可以忽略

 
2.接近装置服务须求的环境准备:1,关闭iptables,selinux
2,配置静态IP、设置主机名 并且在hosts文件下绑定 3.时间一起
4.配备本地iso镜像里的yum仓库,163源epel源 (安装软件)

4.3.4配置cobbler-DHCP

修改cobbler配置

[root@localhost ~]# vim /etc/cobbler/settings # 修改settings中参数,由cobbler控制dhcp
manage_dhcp: 1

修改dhcp.templates配置文件(仅列出修改部分)

[root@localhost ~]# vim /etc/cobbler/dhcp.template
subnet 10.0.0.0 netmask 255.255.255.0 {
     option routers             10.0.0.2;
     option domain-name-servers 10.0.0.2;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.0.0.100 10.0.0.250;

重启服务并一同陈设,改完dhcp必须求sync同步安顿

 1 [root@localhost ~]# systemctl restart cobblerd.service 
 2 [root@localhost ~]# cobbler sync
 3 task started: 2017-10-15_122732_sync
 4 task started (id=Sync, time=Sun Oct 15 12:27:32 2017)
 5 running pre-sync triggers
 6 cleaning trees
 7 removing: /var/lib/tftpboot/pxelinux.cfg/default
 8 removing: /var/lib/tftpboot/grub/efidefault
 9 removing: /var/lib/tftpboot/grub/grub-x86.efi
10 removing: /var/lib/tftpboot/grub/images
11 removing: /var/lib/tftpboot/grub/grub-x86_64.efi
12 removing: /var/lib/tftpboot/s390x/profile_list
13 copying bootloaders
14 trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
15 trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
16 copying distros to tftpboot
17 copying images
18 generating PXE configuration files
19 generating PXE menu structure
20 rendering DHCP files
21 generating /etc/dhcp/dhcpd.conf
22 rendering TFTPD files
23 generating /etc/xinetd.d/tftp
24 cleaning link caches
25 running post-sync triggers
26 running python triggers from /var/lib/cobbler/triggers/sync/post/*
27 running python trigger cobbler.modules.sync_post_restart_services
28 running: dhcpd -t -q
29 received on stdout: 
30 received on stderr: 
31 running: service dhcpd restart
32 received on stdout: 
33 received on stderr: Redirecting to /bin/systemctl restart  dhcpd.service
34 
35 running shell triggers from /var/lib/cobbler/triggers/sync/post/*
36 running python triggers from /var/lib/cobbler/triggers/change/*
37 running python trigger cobbler.modules.scm_track
38 running shell triggers from /var/lib/cobbler/triggers/change/*
39 *** TASK COMPLETE ***

检查dhcp

[root@localhost ~]# netstat -lnup|grep dhcp
udp        0      0 0.0.0.0:39776           0.0.0.0:*                           53381/dhcpd         
udp        0      0 0.0.0.0:67              0.0.0.0:*                           53381/dhcpd         
udp6       0      0 :::46146                :::*                                53381/dhcpd  

cobbler server    ——-    client
                  192.168.100.221/24 
————————————  装机时候由DHCP自动配置

4.3.5导入CentOs-7的镜像

[root@localhost ~]# mount /dev/cdrom  /mnt # 挂载光盘镜像
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# cobbler import --path=/mnt --name=Centos-7.2 --arch=x86_64 # cobbler导入镜像
task started: 2017-10-15_145401_import
task started (id=Media import, time=Sun Oct 15 14:54:01 2017)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/Centos-7.2-x86_64: # 导入镜像的位置
creating new distro: Centos-7.2-x86_64
trying symlink: /var/www/cobbler/ks_mirror/Centos-7.2-x86_64 -> /var/www/cobbler/links/Centos-7.2-x86_64
creating new profile: Centos-7.2-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/Centos-7.2-x86_64 for Centos-7.2-x86_64
processing repo at : /var/www/cobbler/ks_mirror/Centos-7.2-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/Centos-7.2-x86_64
looking for /var/www/cobbler/ks_mirror/Centos-7.2-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/Centos-7.2-x86_64/repodata
*** TASK COMPLETE ***
  • # --path 镜像路径
  • # --name 为安装源定义一个名字
  • # --arch 指定安装源是32位、64位、ia64, 目前支持的选项有: x86│x86_64│ia64
  • # 安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:CentOS-7.1-x86_64,如果重复,系统会提示导入失败

导入完镜像以后,那么就使查看下cobbler

[root@localhost ks_mirror]# cobbler list                       
distros:
   Centos-7.2-x86_64

profiles:
   Centos-7.2-x86_64

systems:

repos:

images:

mgmtclasses:

packages:

files:

一.  在cobbler server上安装cobbler

4.3.6导入kickstarts配置文件

[root@localhost kickstarts]# ls
default.ks    esxi5-ks.cfg      legacy.ks     sample_autoyast.xml  sample_esx4.ks   sample_esxi5.ks  sample_old.seed
esxi4-ks.cfg  install_profiles  pxerescue.ks  sample_end.ks        sample_esxi4.ks  sample.ks        sample.seed
[root@localhost kickstarts]# pwd
/var/lib/cobbler/kickstarts
[root@localhost kickstarts]# rz
rz waiting to receive.
 zmodem trl+C ȡ

  100%       1 KB    1 KB/s 00:00:01       0 Errors.

查阅导入新闻及默许ks文件

[root@localhost kickstarts]# cobbler report
distros:
==========
Name                           : Centos-7.2-x86_64
Architecture                   : x86_64
TFTP Boot Files                : {}
Breed                          : redhat
Comment                        : 
Fetchable Files                : {}
Initrd                         : /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/initrd.img
Kernel                         : /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/vmlinuz
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart Metadata             : {'tree': 'http://@@http_server@@/cblr/links/Centos-7.2-x86_64'}
Management Classes             : []
OS Version                     : rhel7
Owners                         : ['admin']
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Template Files                 : {}


profiles:
==========
Name                           : Centos-7.2-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : Centos-7.2-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/sample_end.ks  # 默认ks文件,这里需要修改为我们自己配置好的ks文件
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : ['admin']
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm


systems:
==========

repos:
==========

images:
==========

mgmtclasses:
==========

packages:
==========

files:
==========

自个儿ks文件(只是简短安插的,具体可以按本人工作来)

 1 #platform=x86, AMD64, or Intel EM64T
 2 #version=DEVEL
 3 # Install OS instead of upgrade
 4 install
 5 # Keyboard layouts
 6 keyboard 'us'
 7 # Root password
 8 rootpw --iscrypted $1$m1pE0DG6$vALBphGGynqvUzfJaWZ6U1
 9 # Use network installation
10 url --url="$tree"
11 # System language
12 lang en_US
13 # Firewall configuration
14 firewall --disabled
15 # System authorization information
16 auth  --useshadow  --passalgo=sha512
17 # Use graphical install
18 graphical
19 firstboot --disable
20 # SELinux configuration
21 selinux --disabled
22 
23 # Network information
24 network  --bootproto=dhcp --device=eth0
25 network  --bootproto=dhcp --device=eth1
26 # Reboot after installation
27 reboot
28 # System timezone
29 timezone Asia/Shanghai
30 # System bootloader configuration
31 bootloader --location=mbr
32 # Clear the Master Boot Record
33 zerombr
34 # Partition clearing information
35 clearpart --all --initlabel
36 # Disk partitioning information
37 part /boot --asprimary --fstype="ext4" --size=200
38 part swap --fstype="swap" --size=1024
39 part / --fstype="ext4" --grow --size=1
40 %packages
41 @base
42 @core
43 @compat-libraries
44 @debugging
45 @development
46 @gnome-desktop
47 @X Window System
48 %end

检查ks命令

# 写完 ks 文件之后,先通过 validateks 测试一下有没有语法错误
# cobbler validateks
# 通过下面这个命令查看 ks 文件,发现一些逻辑上的问题
# cobbler system getks --name=test

 

编写修改指定ks文件为大家恰好上传的ks

 1 [root@localhost kickstarts]# cobbler profile list
 2    Centos-7.2-x86_64
 3 [root@localhost kickstarts]# cobbler profile edit --name Centos-7.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/Centos7.2-x86_64.cfg  # 编辑profile,修改ks文件为我们刚刚上传的Centos7.2-x86_64.cfg
 4 [root@localhost kickstarts]# cobbler profile edit --name Centos-7.2-x86_64 --kopts='net.ifnames=0 biosdevname=0' 
   # 修改安装系统的内核参数,在CentOS7系统有一个地方变了,就是网卡名变成eno16777736这种形式,但是为了运维标准化,我们需要将它变成我们常用的eth0,因此使用上面的参数。但要注意是CentOS7才需要上面的步骤,CentOS6不需要。
 5 [root@localhost kickstarts]# cobbler profile report
 6 Name                           : Centos-7.2-x86_64
 7 TFTP Boot Files                : {}
 8 Comment                        : 
 9 DHCP Tag                       : default
10 Distribution                   : Centos-7.2-x86_64
11 Enable gPXE?                   : 0
12 Enable PXE Menu?               : 1
13 Fetchable Files                : {}
14 Kernel Options                 : {'biosdevname': '0', 'net.ifnames': '0'}
15 Kernel Options (Post Install)  : {}
16 Kickstart                      : /var/lib/cobbler/kickstarts/Centos7.2-x86_64.cfg  # ks文件已经修改为我们上传的ks文件
17 Kickstart Metadata             : {}
18 Management Classes             : []
19 Management Parameters          : <<inherit>>
20 Name Servers                   : []
21 Name Servers Search Path       : []
22 Owners                         : ['admin']
23 Parent Profile                 : 
24 Internal proxy                 : 
25 Red Hat Management Key         : <<inherit>>
26 Red Hat Management Server      : <<inherit>>
27 Repos                          : []
28 Server Override                : <<inherit>>
29 Template Files                 : {}
30 Virt Auto Boot                 : 1
31 Virt Bridge                    : xenbr0
32 Virt CPUs                      : 1
33 Virt Disk Driver Type          : raw
34 Virt File Size(GB)             : 5
35 Virt Path                      : 
36 Virt RAM (MB)                  : 512
37 Virt Type                      : kvm

  yum install cobbler cobbler-web tftp*
rsync xinetd http* syslinux dhcp* pykickstart

4.3.7同步cobbler

 1 [root@localhost kickstarts]# cobbler sync
 2 task started: 2017-10-15_154709_sync
 3 task started (id=Sync, time=Sun Oct 15 15:47:09 2017)
 4 running pre-sync triggers
 5 cleaning trees
 6 removing: /var/www/cobblerCentos-7.2-x86_64
 7 removing: /var/lib/tftpboot/pxelinux.cfg/default
 8 removing: /var/lib/tftpboot/grub/efidefault
 9 removing: /var/lib/tftpboot/grub/grub-x86.efi
10 removing: /var/lib/tftpboot/grub/images
11 removing: /var/lib/tftpboot/grub/grub-x86_64.efi
12 removing: /var/lib/tftpbootCentos-7.2-x86_64
13 removing: /var/lib/tftpboot/s390x/profile_list
14 copying bootloaders
15 trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
16 trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
17 copying distros to tftpboot
18 copying files for distro: Centos-7.2-x86_64
19 trying hardlink /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/vmlinuz -> /var/lib/tftpbootCentos-7.2-x86_64/vmlinuz
20 trying hardlink /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/initrd.img -> /var/lib/tftpbootCentos-7.2-x86_64/initrd.img
21 copying images
22 generating PXE configuration files
23 generating PXE menu structure
24 copying files for distro: Centos-7.2-x86_64
25 trying hardlink /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/vmlinuz -> /var/www/cobblerCentos-7.2-x86_64/vmlinuz
26 trying hardlink /var/www/cobbler/ks_mirror/Centos-7.2-x86_64pxeboot/initrd.img -> /var/www/cobblerCentos-7.2-x86_64/initrd.img
27 Writing template files for Centos-7.2-x86_64
28 rendering DHCP files
29 generating /etc/dhcp/dhcpd.conf
30 rendering TFTPD files
31 generating /etc/xinetd.d/tftp
32 processing boot_files for distro: Centos-7.2-x86_64
33 cleaning link caches
34 running post-sync triggers
35 running python triggers from /var/lib/cobbler/triggers/sync/post/*
36 running python trigger cobbler.modules.sync_post_restart_services
37 running: dhcpd -t -q
38 received on stdout: 
39 received on stderr: 
40 running: service dhcpd restart
41 received on stdout: 
42 received on stderr: Redirecting to /bin/systemctl restart  dhcpd.service
43 
44 running shell triggers from /var/lib/cobbler/triggers/sync/post/*
45 running python triggers from /var/lib/cobbler/triggers/change/*
46 running python trigger cobbler.modules.scm_track
47 running shell triggers from /var/lib/cobbler/triggers/change/*
48 *** TASK COMPLETE ***

[root@bokeyuan ~]``# yum install cobbler cobbler-web tftp* rsync xinetd http* syslinux dhcp* pykickstart

5.新建一个虚拟机测试

为防止生出不明不白难点,先把服务端所有服务重启

[root@localhost cobbler]#systemctl restart xinetd.service
[root@localhost cobbler]#systemctl restart cobblerd.service
[root@localhost cobbler]#systemctl restart httpd.service

新建虚拟机从pxe启动,即便出现下边图形,则表明已经成功了

澳门金沙国际 9

上图中网址也足以定制为大家自身的

[root@localhost cobbler]# vim /etc/cobbler/pxe/pxedefault.template
MENU TITLE Cobbler | I'm here # 修改这里为你想修改的内容
[root@localhost cobbler]# cobbler sync # 同步之后就可以看到效果了

Loaded plugins: fastestmirror, langpacks

6.通过MAC地址定制化安装

咱俩得以依据差距的MAC地址来给安装
不一样的操作系统,配置不相同的静态iP,设置不相同的主机名等等,虚拟机查看MAC地址步骤如图:

澳门金沙国际 10

布局定制化安装(必要证实,后续验证后添加验证结果)

[root@localhost cobbler]# cobbler system add \   
--name=linux-web01 \
--mac=00:0C:29:3B:03:9B \
--profile=Centos-7.2-x86_64 \
--ip-address=10.0.0.200 \
--subnet=255.255.255.0 \
--gateway=10.0.0.2 \
--interface=eth0 \
--static=1 \
--hostname=linux-web01 \
--name-servers="10.0.0.2" \
--kickstart=/var/lib/cobbler/kickstarts/Centos7.2-x86_64.cfg

system add  #  添加定制系统

name  # 定制系统名称

mac # mac地址

profile #指定profile

ip-address # 指定IP地址

subnet # 指定子网掩码

gateway # 指定网关

interface # 指定网卡,eth0上边配置已经修改,centos7暗许网卡名称不是eth0

static # 1表示启用静态IP

hostname # 定义hostname

name-server # dns服务器

kickstart # 指定ks文件

布局成功后大家可以查阅到刚刚定制的种类

[root@localhost cobbler]# cobbler system list
linux-web01

接下去我们创造一个虚拟机,mac地址为00:0C:29:3B:03:9B,启动后您就会意识自动进入安装系统了,等设置完今后,所有的配置都和大家当下安装的如出一辙。

Loading mirror speeds from cached hostfile

7.选择koan已毕重新安装系统

在客户端安装koan(要布局好源)

[root@localhost ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
[root@localhost ~]# yum install koan

查阅cobbler上的配备文件

1 [root@localhost ~]# koan --server=10.0.0.101 --list=profiles
2 - looking for Cobbler at http://10.0.0.101:80/cobbler_api
3 Centos-7.2-x86_64

重新安装客户端系统

[root@localhost ~]# koan --replace-self --server=10.0.0.101 --profile=webserver1

重启系统后会自动重装系统

 

Package ``rsync``-3.0.9-17.el7.x86_64 already installed and latest version

cobbler-web相关安插,后续小说再更。。。

参考作品:

Package 12:dhcp-common-4.2.5-47.el7.CentOS.x86_64 already installed and latest version

Package 12:dhcp-libs-4.2.5-47.el7.centos.x86_64 already installed and latest version

Package pykickstart-1.99.66.10-1.el7.noarch already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: mod_wsgi ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: PyYAML ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package cobbler-web.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: mod_ssl ``for
package: cobbler-web-2.6.3-1.el6.noarch

--> Processing Dependency: Django ``for
package: cobbler-web-2.6.3-1.el6.noarch

---> Package dhcp.x86_64 12:4.2.5-47.el7.centos will be installed

---> Package httpcomponents-client.noarch 0:4.2.5-5.el7_0 will be installed

--> Processing Dependency: mvn(commons-logging:commons-logging) ``for
package: httpcomponents-client-4.2.5-5.el7_0.noarch

--> Processing Dependency: mvn(commons-codec:commons-codec) ``for
package: httpcomponents-client-4.2.5-5.el7_0.noarch

---> Package httpcomponents-core.noarch 0:4.2.4-6.el7 will be installed

---> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed

--> Processing Dependency: ``/etc/mime``.types ``for
package: httpd-2.4.6-45.el7.centos.x86_64

---> Package httpd-devel.x86_64 0:2.4.6-45.el7.centos will be installed

--> Processing Dependency: apr-util-devel ``for
package: httpd-devel-2.4.6-45.el7.centos.x86_64

--> Processing Dependency: apr-devel ``for
package: httpd-devel-2.4.6-45.el7.centos.x86_64

---> Package httpd-manual.noarch 0:2.4.6-45.el7.centos will be installed

---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos will be installed

---> Package syslinux.x86_64 0:4.05-13.el7 will be installed

---> Package tftp.x86_64 0:5.2-13.el7 will be installed

---> Package tftp-server.x86_64 0:5.2-13.el7 will be installed

---> Package xinetd.x86_64 2:2.3.15-13.el7 will be installed

--> Running transaction check

---> Package Django14.noarch 0:1.4.20-1.el6 will be installed

--> Processing Dependency: python(abi) = 2.6 ``for
package: Django14-1.4.20-1.el6.noarch

--> Processing Dependency: python-simplejson ``for
package: Django14-1.4.20-1.el6.noarch

---> Package PyYAML.x86_64 0:3.10-11.el7 will be installed

--> Processing Dependency: libyaml-0.so.2()(64bit) ``for
package: PyYAML-3.10-11.el7.x86_64

---> Package apache-commons-codec.noarch 0:1.8-7.el7 will be installed

---> Package apache-commons-logging.noarch 0:1.1.2-7.el7 will be installed

--> Processing Dependency: mvn(logkit:logkit) ``for
package: apache-commons-logging-1.1.2-7.el7.noarch

--> Processing Dependency: mvn(log4j:log4j) ``for
package: apache-commons-logging-1.1.2-7.el7.noarch

--> Processing Dependency: mvn(avalon-framework:avalon-framework-api) ``for
package: apache-commons-logging-1.1.2-7.el7.noarch

---> Package apr-devel.x86_64 0:1.4.8-3.el7 will be installed

---> Package apr-util-devel.x86_64 0:1.5.2-6.el7 will be installed

--> Processing Dependency: openldap-devel(x86-64) ``for
package: apr-util-devel-1.5.2-6.el7.x86_64

--> Processing Dependency: libdb-devel(x86-64) ``for
package: apr-util-devel-1.5.2-6.el7.x86_64

--> Processing Dependency: expat-devel(x86-64) ``for
package: apr-util-devel-1.5.2-6.el7.x86_64

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed

---> Package mod_ssl.x86_64 1:2.4.6-45.el7.centos will be installed

---> Package mod_wsgi.x86_64 0:3.4-12.el7_0 will be installed

--> Running transaction check

---> Package Django14.noarch 0:1.4.20-1.el6 will be installed

--> Processing Dependency: python(abi) = 2.6 ``for
package: Django14-1.4.20-1.el6.noarch

--> Processing Dependency: python-simplejson ``for
package: Django14-1.4.20-1.el6.noarch

---> Package avalon-framework.noarch 0:4.3-10.el7 will be installed

--> Processing Dependency: xalan-j2 ``for
package: avalon-framework-4.3-10.el7.noarch

---> Package avalon-logkit.noarch 0:2.1-14.el7 will be installed

--> Processing Dependency: tomcat-servlet-3.0-api ``for
package: avalon-logkit-2.1-14.el7.noarch

--> Processing Dependency: jms ``for
package: avalon-logkit-2.1-14.el7.noarch

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed

---> Package libdb-devel.x86_64 0:5.3.21-19.el7 will be installed

---> Package libyaml.x86_64 0:0.1.4-11.el7_0 will be installed

---> Package log4j.noarch 0:1.2.17-15.el7 will be installed

--> Processing Dependency: mvn(javax.mail:mail) ``for
package: log4j-1.2.17-15.el7.noarch

---> Package openldap-devel.x86_64 0:2.4.40-13.el7 will be installed

--> Processing Dependency: cyrus-sasl-devel(x86-64) ``for
package: openldap-devel-2.4.40-13.el7.x86_64

--> Running transaction check

---> Package Django14.noarch 0:1.4.20-1.el6 will be installed

--> Processing Dependency: python(abi) = 2.6 ``for
package: Django14-1.4.20-1.el6.noarch

--> Processing Dependency: python-simplejson ``for
package: Django14-1.4.20-1.el6.noarch

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package cyrus-sasl-devel.x86_64 0:2.1.26-20.el7_2 will be installed

---> Package geronimo-jms.noarch 0:1.1.1-19.el7 will be installed

---> Package javamail.noarch 0:1.4.6-8.el7 will be installed

---> Package tomcat-servlet-3.0-api.noarch 0:7.0.69-10.el7 will be installed

---> Package xalan-j2.noarch 0:2.7.1-23.el7 will be installed

--> Processing Dependency: xerces-j2 ``for
package: xalan-j2-2.7.1-23.el7.noarch

--> Processing Dependency: osgi(org.apache.xerces) ``for
package: xalan-j2-2.7.1-23.el7.noarch

--> Running transaction check

---> Package Django14.noarch 0:1.4.20-1.el6 will be installed

--> Processing Dependency: python(abi) = 2.6 ``for
package: Django14-1.4.20-1.el6.noarch

--> Processing Dependency: python-simplejson ``for
package: Django14-1.4.20-1.el6.noarch

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package xerces-j2.noarch 0:2.11.0-17.el7_0 will be installed

--> Processing Dependency: xml-commons-resolver >= 1.2 ``for
package: xerces-j2-2.11.0-17.el7_0.noarch

--> Processing Dependency: xml-commons-apis >= 1.4.01 ``for
package: xerces-j2-2.11.0-17.el7_0.noarch

--> Processing Dependency: osgi(org.apache.xml.resolver) ``for
package: xerces-j2-2.11.0-17.el7_0.noarch

--> Processing Dependency: osgi(javax.xml) ``for
package: xerces-j2-2.11.0-17.el7_0.noarch

--> Running transaction check

---> Package Django14.noarch 0:1.4.20-1.el6 will be installed

--> Processing Dependency: python(abi) = 2.6 ``for
package: Django14-1.4.20-1.el6.noarch

--> Processing Dependency: python-simplejson ``for
package: Django14-1.4.20-1.el6.noarch

---> Package cobbler.noarch 0:2.6.3-1.el6 will be installed

--> Processing Dependency: python-simplejson ``for
package: cobbler-2.6.3-1.el6.noarch

--> Processing Dependency: python-cheetah ``for
package: cobbler-2.6.3-1.el6.noarch

---> Package xml-commons-apis.noarch 0:1.4.01-16.el7 will be installed

---> Package xml-commons-resolver.noarch 0:1.2-15.el7 will be installed

--> Finished Dependency Resolution

Error: Package: Django14-1.4.20-1.el6.noarch (cobbler)

``Requires: python-simplejson

Error: Package: cobbler-2.6.3-1.el6.noarch (cobbler)

``Requires: python-simplejson

Error: Package: Django14-1.4.20-1.el6.noarch (cobbler)

``Requires: python(abi) = 2.6

``Installed: python-2.7.5-48.el7.x86_64 (@anaconda)

``python(abi) = 2.7

``python(abi) = 2.7

Error: Package: cobbler-2.6.3-1.el6.noarch (cobbler)

``Requires: python-cheetah

``You could try using --skip-broken to work around the problem

** Found 3 pre-existing rpmdb problem(s), ``'yum check'
output follows:

ipa-client-4.4.0-12.el7.centos.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-12.el7.centos.x86_64

ipa-client-common-4.4.0-12.el7.centos.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-12.el7.centos.noarch

ipa-common-4.4.0-12.el7.centos.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-12.el7.centos.noarch

 报错消除:提醒–skip-broken
,检查发现本身yum源不全yum不能够安装上边多个依赖包。补全yum源化解

安装完结,启动软件

[root@bokeyuan ~]# systemctl restart cobblerd.service
[root@bokeyuan ~]# systemctl restart httpd.service
[root@bokeyuan ~]# systemctl enable
cobblerd.service  //开机自启动
Created symlink from
/etc/systemd/system/multi-user.target.wants/cobblerd.service to
/usr/lib/systemd/system/cobblerd.service.
[root@bokeyuan ~]# systemctl enable httpd.service  //开机自启动
Created symlink from
/etc/systemd/system/multi-user.target.wants/httpd.service to
/usr/lib/systemd/system/httpd.service.

何以启动apache?血的训诫,排了很久。不先启动apache
后续cobbler check 报python file 的荒唐!!!

二.大旨配置

[root@bokeyuan ~]``# cobbler check

The 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 : change ``'disable' to ``'no' in /etc/xinetd``.d``/tftp

4 : 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.

5 : ``enable and start rsyncd.service with systemctl

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

7 : 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 one

8 : fencing tools were not found, and are required to use the (optional) power management features. ``install
cman or fence-agents to use them

 

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

 一步步化解上述须要,部分急需可忽略。个体差距不同逐个人必要数量也不相同,基本上大致

消除须求1、2、7
# openssl passwd -1 -salt ‘werwqerwqr’ ‘123456’       
–123456为密码(那是电动安装客户端系统成功后的root登录密码),werwqerwqr为随机字节干扰码(随便写)
$1$werwqerw$.prcfrYFbwuvkD8XspayN.

# vim /etc/cobbler/settings
384 server: 192.168.100.221   –换成cobbler服务器端的IP
272 next_server: 192.168.100.221   –同上
101 default_password_crypted: “$1$werwqerw$.prcfrYFbwuvkD8XspayN.” 
–把密码字符串换成你上边发生的字符串(此密码为客户机安装后的root登录密码)

消除须要3
# vim /etc/xinetd.d/tftp
澳门金沙国际,        disable = no    –yes改为no

竭泽而渔急需5

#systemctl restart rsyncd.service

#systemctl enable  rsyncd.service

化解急需8
# yum install fence-agents

OK,剩下的要求像

4 : 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.
6 : debmirror package is not installed, it will be required to manage
debian deployments and repositories

(难点4方可选拔cobbler get-loaders化解,但须求有外网和外网的yum源
跳过,未来是NAT方式;难点6 是有关debian系统的,大家那边可以忽略)

最后# systemctl restart cobblerd.service 重起下cobbler补鞋匠服务!

三.导入centos7.3的iso镜像

自作者的环境iso镜像挂载在/yum目录,此拷贝步骤时间较长

# cobbler import –path=/yum/ –name=centos7.3

# cobbler distro list   –导入成功后,确认导入的镜像名
  centos7.3-x86_64
# cobbler profile list   –导入成功后,确认私自认同的profile名
  centos7.3-x86_64

[root@bokeyuan ~]# cobbler import --path=/yum/ --name=centos7.3
task started: 2017-09-03_175701_import
task started (id=Media import, time=Sun Sep  3 17:57:01 2017)
Found a candidate signature: breed=RedHat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/centos7.3:
creating new distro: centos7.3-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos7.3 -> /var/www/cobbler/links/centos7.3-x86_64
creating new profile: centos7.3-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/centos7.3 for centos7.3-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos7.3
need to process repo/comps: /var/www/cobbler/ks_mirror/centos7.3
looking for /var/www/cobbler/ks_mirror/centos7.3/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos7.3/repodata
*** TASK COMPLETE *** 

四.修改dhcp配置
# vim
/etc/cobbler/dhcp.template  –在此文件的第21行到第25行修改成你对号入座的网段和ip 
 

subnet 192.168.100.0 netmask 255.255.255.0 {
    option routers            192.168.100.221;
    option domain-name-servers 192.168.100.221;
    option subnet-mask        255.255.255.0;
    range dynamic-bootp        192.168.100.100 192.168.100.254;

–图形的操作进度那里大概后续还有这一步 主要

# vim /etc/cobbler/settings 
 –再去修改那一个布局文件,改成dhcp服务由cobbler来管理
242 manage_dhcp: 1       –把0改为1

#  systemctl restart cobblerd.service  –保存后,再重启此服务

五.使用cobbler sync同步,并启动xinetd服务

下边的cobbler sync
很要紧,如若这步报错一定要排出来,就经历来说那步出错一般是IP配置出错,记得仔细一点,个体差别不用就不详细表述~  

# cobbler sync

[root@bokeyuan ~]``# cobbler sync

task started: 2017-09-03_180107_sync

task started (``id``=Sync, ``time``=Sun Sep  3 18:01:07 2017)

running pre-``sync triggers

cleaning trees

removing: ``/var/www/cobbler/images/centos7``.3-x86_64

removing: ``/var/lib/tftpboot/pxelinux``.cfg``/default

removing: ``/var/lib/tftpboot/grub/images

removing: ``/var/lib/tftpboot/grub/efidefault

removing: ``/var/lib/tftpboot/images/centos7``.3-x86_64

removing: ``/var/lib/tftpboot/s390x/profile_list

copying bootloaders

trying hardlink ``/usr/share/syslinux/pxelinux``.0 -> ``/var/lib/tftpboot/pxelinux``.0

trying hardlink ``/usr/share/syslinux/menu``.c32 -> ``/var/lib/tftpboot/menu``.c32

trying hardlink ``/usr/share/syslinux/memdisk
-> ``/var/lib/tftpboot/memdisk

copying distros to tftpboot

copying files ``for distro: centos7.3-x86_64

trying hardlink ``/var/www/cobbler/ks_mirror/centos7``.3``/images/pxeboot/vmlinuz
-> ``/var/lib/tftpboot/images/centos7``.3-x86_64``/vmlinuz

trying hardlink ``/var/www/cobbler/ks_mirror/centos7``.3``/images/pxeboot/initrd``.img -> ``/var/lib/tftpboot/images/centos7``.3-x86_64``/initrd``.img

copying images

generating PXE configuration files

generating PXE menu structure

copying files ``for distro: centos7.3-x86_64

trying hardlink ``/var/www/cobbler/ks_mirror/centos7``.3``/images/pxeboot/vmlinuz
-> ``/var/www/cobbler/images/centos7``.3-x86_64``/vmlinuz

trying hardlink ``/var/www/cobbler/ks_mirror/centos7``.3``/images/pxeboot/initrd``.img -> ``/var/www/cobbler/images/centos7``.3-x86_64``/initrd``.img

Writing template files ``for centos7.3-x86_64

rendering TFTPD files

generating ``/etc/xinetd``.d``/tftp

processing boot_files ``for distro: centos7.3-x86_64

cleaning link caches

running post-``sync triggers

running python triggers from ``/var/lib/cobbler/triggers/sync/post/``*

running python trigger cobbler.modules.sync_post_restart_services

running shell triggers from ``/var/lib/cobbler/triggers/sync/post/``*

running python triggers from ``/var/lib/cobbler/triggers/change/``*

running python trigger cobbler.modules.scm_track

running shell triggers from ``/var/lib/cobbler/triggers/change/``*

*** TASK COMPLETE ***

# systemctl restart xinetd.service
# systemctl enable xinetd.service

六.新建另一个虚构机 选用网络安装PXE
(保障平等私有网络,并且最好2G内存,内存小的话会在设置时报空间不够的谬误),举行设置测试

澳门金沙国际 11   

设置到位后,更改boot指导

澳门金沙国际 12

更加多详情见请继续阅读下一页的出色内容
http://www.linuxidc.com/Linux/2017-09/146706p2.htm

澳门金沙国际 13

相关文章