Cobbler 无人值守介绍与自动部署批量安装

Cobbler 介绍

Cobbler 配置目录说明

安装:yum install cobbler

配置文件目录 /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 : 模块的配置文件

cobbler 目录介绍

数据目录:

/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/images/ : 导入发行版的kernel和initrd镜像用于远程网络启动
/var/www/cobbler/repo_mirror/: yum 仓库存储目录

日志目录:

/var/log/cobbler/installing: 客户端安装日志
/var/log/cobbler/cobbler.log : cobbler日志

cobbler 命令介绍

cobbler check 核对当前设置是否有问题

cobbler list 列出所有的cobbler元素

cobbler report 列出元素的详细信息

cobbler sync 同步配置到数据目录,更改配置最好都要执行下

cobbler reposync 同步yum仓库

cobbler distro 查看导入的发行版系统信息

cobbler system 查看添加的系统信息

cobbler profile 查看配置信息

cobbler 重要的参数

/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:<cobbler服务器的 IP 地址>

cobbler PXE启动错误报告-来自网络

PXE-E00:Could not find enough free base memory.

          PXE主代码和UNDI运行时模块从闪存或上位内存拷贝至基本内存顶部480K(78000h)至640K(A0000h)的剩余空间位置,这段内存必须被系统BIOS填零,如果这些内存没有填零,PXE ROM里的重布置代码将认为这些内存已经被系统BIOS或其它启动ROM占用了

PXE-E01:PCI Vendor and Device IDs do not match!

          此信息在成品BIOS中不可能出现,当系统BIOS初始化基于PCI的ROM时,它将假设PCI总线/设备/模块(Bus/Device/Function)值已在AX寄存器里通过审核,如果AX寄存器里定义的PCI设备不匹配UNDI设备,将出现此错误代码。

PXE-E04:Error reading PCI configuration space

          如果任何PCI BIOS调用导致PCI设置空间返回错误代码,此信息将出现,此信息将不会在成品BIOS和硬件上出现。

PXE-E05:EEPROM checksum error

          如果网卡EEPROM内容被损坏,将出现此信息。EEPROM内容的损坏通常发生在正在对网卡EEPROM进行编程时系统突然复位(Reset)或掉电的情形下,如果出现此信息,PXE ROM将不执行引导。

PXE-E06:Option ROM requires DDIM support

          此信息将不会在成品BIOS中出现,PCI可选ROM通常必须被设置为DDIM可选ROM(通常必须被安置在读/写上位内存中)

PXE-E07:PCI BIOS calls not supported

          此信息将不会在成品BIOS中出现,PCI BIOS必须有PCI BIOS服务。

PXE-E08:Unexpected API error.API:xxxxh Status:xxxxh

          如果PXE API返回一个运行时加载器(Runtime Loader)预料之外的状态代码,将出现此信息

PXE-E09:Unexpected UNDI loader error.Status:xxxxh

          如果UNDI运行时加载器(Runtime Loader)返回预料之外的状态代码,将出现此信息

ARP错误代码

PXE-E11:ARP timeout PXE ROM

          将重试四遍ARP请求,如果无法获取任何有效的ARP答复,将出现此信息,此信息通常源于一些网络和服务设置错误,通常的原因有:

                  1.在DHCP主服务器上设置了DHCP类标识符(Option 60)却在另一台服务器上安装了ProxyDHCP服务。

                  2.使用了不响应ARP请求的路由器

BIOS和BIS错误代码

PXE-E20:BIOS extended memory copy error.AH==nn

          如果BIOS扩展内存拷贝服务返回一个错误信息,此信息将出现,在成品BIOS中将不会遭遇此信息,代码”nn”为BIOS扩展内存拷贝服务(Int 15h,AH=87h)返回的错误代码。

PXE-E21:BIS integrity check failed

          如果在扩展内存中的BIS映像损坏,则将显示此信息

PXE-E22:BIS image/credential validation failed

          下载的映像和证书不匹配客户端关键

PXE-E23:BIS initialization failed BIS

          无法被初始化,没有更多可用数据

PXE-E24:BIS shutdown failed BIS

          无法停止,没有更多可用数据

PXE-E25:BIS get boot object authorization check flag failed–2

          PXE启动芯片出错代码表无法检测BIS已启用/已禁用

PXE-E26:BIS free memory failed

          无法释放BIS分配内存

PXE-E27:BIS get signature information failed

          请求BIS证书类型信息不能被确定。

PXE-E28:BIS bad entry structure checksum SM BIOS

          表中的BIS入口结构无效。

TFTP/MTFTP错误代码

PXE-E32:TFTP open timeout TFTP”Open”

          请求没有应答,验证TFTP服务是否正在运行。

PXE-E35:TFTP read timeout

          未收到下一个TFTP数据包

PXE-E36:Error received from TFTP server

          从TFTP服务器上收到了一个错误的TFTP数据包

PXE-E38:TFTP cannot open connection

          当试图送出一个TFTP”Open”包时发生了一个硬件错

PXE-E39:TFTP cannot read from connection

          当试图送出一个TFTP应答包时发生了一个硬件错

PXE-E3A:TFTP too many packages.

          此信息意味着发生了下列两种情况中的一个:

                1.你试图用TFTP下载一个比分配的缓冲区更大的文件

                2.你作为一个从(Slave)客户端使用MTFTP开始下载一个文件,而当你变成一个主(Master)客户端时,此文件的大小发生了改变。

PXE-E3B:TFTP error– File not found

          请求的文件在TFTP服务器上无法找到。

PXE-E3C:TFTP error– Access violation

          已在TFTP服务器上找到了请求的文件,但TFTP服务没有足够的访问权限开启/读取文件。

PXE-E3F:TFTP packet size is invalid

          收到的TFTP包大小超过1456bytes BOOTP/DHCP错误代码

PXE-E51:No DHCP or proxyDHCP offers were received

          客户端没有收到任何有效的DHCP、BOOTP或proxyDHCP应答。

PXE-E52:proxyDHCP offers were received.No DHCP offers were received

          客户端没有收到任何有效的DHCP或BOOTP应答,但客户端收到了至少一个有效的proxyDHCP应答。

PXE-E53:No boot filename received

          客户端收到了至少一个有效的DHCP/BOOTP应答,但没有启动文件名可下载。

PXE-E55:proxyDHCP service did not reply to request on port 4011

          客户端发出一个proxyDHCP请求到DHCP服务器的4011端口并没有收到回复。

UNDI错误代码

PXE-E60:Invalid UNDI API function number

          一个被基本代码所使用的API在UNDI ROM中无法执行。

PXE-E61:Media test failed,check cable

          网线没有插或没有连接,可能是网线坏、网卡坏或连接问题。

PXE-E63:Error while initializing the NIC

          初始化网卡硬件时出现错误,建议换网卡。

PXE-E64:Error while initializing the PHY

          试图初始化PHY硬件时出现错误,建议换网卡。

PXE-E65:Error while reading the configuration data

          读取网卡设置数据时出现错误,建议换网卡。

PXE-E66:Error while reading the initialization data

          读取网卡初始化数据时出现错误,建议换网卡。

PXE-E67:Invalid MAC address

          存储在这块网卡中的MAC地址无效,建议换网卡

PXE-E68:Invalid EEPROM checksum

          EEPROM校验和错误,EEPROM内容已损坏,建议换网卡

PXE-E69:Error while setting interrupt

          无法配置硬件中断,建议换网卡。

Bootstrap和Discovery错误代码

PXE-E74:Bad or missing PXE menu and/or prompt information

          已检测到PXE标识但启动菜单和/或启动命令提示符标识未发现/不存在

PXE-E76:Bad or missing multicast discovery address

          多播创建已启动但多播创建地址标识不符

PXE-E77:Bad or missing discovery server list

          多播和广播创建(Discovery)都被禁用,或使用服务器列表启用,但服务器列表标识未发现/不存在

PXE-E78:Could not locate boot server

          有效的引导服务器应答未被客户端收到

PXE-E79:NBP is too big to fit in free base memory

          NBP太大,超过客户端基本内存容量

PXE-E7A:Client could not locate asecure server

          当客户端未从启动服务器收到任何安全信息并且客户端上的BIS已被启用,将显示此信息。

PXE-E7B:Missing MTFTP server IP address

          当ROM未收到PXE创建标识或proxyDHCP回应和DHCP SIADDR区域被设置为0.0.0.0,将显示此信息。

分类错误代码

PXE-EA0:Network boot canceled by keystroke

          用户在DHCP/创建/TFTP过程中按了”Esc”或”Ctrl C”键

基础代码/UNDI Loader错误代码

PXE-EC1:BaseCode ROM ID structure was not found UNDI

          引导模块不能发现基础代码ROM ID结构。如果系统中有基础代码ROM映像,它可能已经损坏了

PXE-EC3:BaseCode ROM ID structure is invalid

          基础代码ROM ID结构有问题,基础代码ROM映像已经损坏了

PXE-EC4:UNDI ROM ID structure was not found

          基础代码载入模块不能在UNDI ROM ID结构中定位

PXE-EC5:UNDI ROM ID structure is invalid UNDI

          ROM映像已经损坏了

PXE-EC6:UNDI driver image is invalid UNDI

          ROM映像已经损坏了

PXE-EC8:!PXE structure was not found in UNDI driver code segment

          UNDI ROM映像已经损坏了,或者未能被BIOS载入,此错误信息通常系如下一个或三个原因所致:

                  1.当即将调用一个LOM映像的时间点,网卡映像正在被编程进BIOS

                  2.在PXE可选ROM开始启动之前,PXE可选ROM载入自检内存管理器(POST Memory Manager,$PMM)分配的内存期间被损坏或删除

                  3.在载入ROM结构期间UNDI_Loader结构未被正确载入

PXE-EC9:PXENV structure was not found in UNDI driver code segment

          UNDI ROM映像可能被损坏了,或未被BIOS载入,此错误信息通常系如下三个原因所致:

                  1.当即将调用一个LOM映像的时间点,网卡映像正在被编程进BIOS

                  2.在PXE可选ROM开始启动之前,PXE可选ROM载入自检内存管理器(POST Memory Manager,$PMM)分配的内存期间被损坏或删除。

                  3.在载入ROM结构期间UNDI_Loader结构未被正确载入。

安装

环境准备

  • 准备两台主机,如CentOS6和centos7
  • centos7当作server服务器
  • 关闭selinux
  • 关闭防火墙

安装

cobbler包光盘里是没有的,要配置epel源,这里就说怎么配置epel源了,在yum.repos.d/目录下照葫芦画瓢就可,配置好后执行如下命令安装

yum install –y cobbler 

安装成功后,我们发现它还安装了其他的服务

Cobbler 无人值守介绍与自动部署批量安装

备注:我们搭建cobbler-系统部署需要用到httpd、tftp-server、dhcp服务,从图上可以看出它没有安装dhcp服务,所以我们要安装下dhcp服务

yum install –y dhcp

开启服务

http服务

systemctl start httpd
#开启服务
systemctl enable httpd
#设置开机自启动

tftp-server服务

systemctl start tftp
#开启服务
systemctl enable tftp
#开机自启动

cobbler服务

systemctl start cobblerd
#开启服务
systemctl enable cobblerd
#开机自启动

cobbler环境检查

执行

cobbler check
#

会出现如下提示,配置缺少的东西

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

OK 根据提示一步一步来解决

步骤

1、第一个提示:在/etc/cobbler/settings 文件中server字段必须要有一个别人可访问的IP地址,来提供网络服务,那么我们是在centos7上搭建的所以是本机地址。

①编辑配置文件

vim etc/cobbler/settings
#编辑配置文件

Cobbler 无人值守介绍与自动部署批量安装

②刷新配置文件并环境检查

systemctl restart cobblerd
#重启服务,重新读取修改的配置文件
cobbler check
#环境检查

步骤二

#环境检查后发现少了一项,那么下面接着还是从第一项开始操作
1 : 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.
2 : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp
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 : enable and start rsyncd.service with systemctl
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : 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
7 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

如上第一条:’next_server’ 地址不应该是127.0.0.1

所以修改它的地址,这个地址也就是你tftp服务器所在的主机地址,我们把服务都安装在一台主机上了,所以和上面地址一样

①编辑配置文件

vim etc/cobbler/settings
#编辑配置文件

Cobbler 无人值守介绍与自动部署批量安装

②重复步骤一中的②命令来重读配置文件与环境检查

步骤三

#环境检查后发现又少了一条,下面接这来…
1 : change ‘disable’ to ‘no’ in /etc/xinetd.d/tftp
2 : 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.
3 : enable and start rsyncd.service with systemctl
4 : debmirror package is not installed, it will be required to manage debian deployments and repositories
5 : 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
6 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

如上第一条:提示更改/etc/xinetd.d/tftp配置文件中’disable’状态改为‘no’说白了也就是开启tftp服务

因为我们用的是centos7不需要xinetd.d了,前面已经开启了tftp服务,这步忽略,看下一个提示

第二条:在/var/lib/cobbler/loaders目录下少了一些必要的文件,用’cobbler get-loaders’ 命令来获取,这时候需要主机联网下载

cobbler get-loaders

我们先来看看这个目录

Cobbler 无人值守介绍与自动部署批量安装

①生成必要文件

Cobbler 无人值守介绍与自动部署批量安装

我们知道出现的这些文件是要放在/var/lib/tftpboot/这里的,我们看下这个目录的信息

Cobbler 无人值守介绍与自动部署批量安装

用如上环境检查中给出的提示进行同步

cobbler sync
#数据同步 

再次查看下/var/lib/tftpboot目录结构

Cobbler 无人值守介绍与自动部署批量安装

②重复步骤一中的②命令

#又少了,继续
1 : enable and start rsyncd.service with systemctl
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : 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
4 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

步骤四

第一条:开启rsyncd.service 服务,我们没有用这个服务,忽略

第二条:是针对debian发行版的系统配置,忽略

第三条:修改kickstart文件的默认口令

①编辑配置文件

vim /etc/cobbler/settings
#

Cobbler 无人值守介绍与自动部署批量安装

②重复步骤一中的②命令

#少了一条
1 : enable and start rsyncd.service with systemctl
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

如上第一、二上面说了忽略,看第三条,意思说配置电源项,和硬件有关,忽略

步骤五

配置dhcp

①编辑配置文件

vim /etc/cobbler/settings
#

Cobbler 无人值守介绍与自动部署批量安装

② 改cobbler提供的dhcp配置文件模板

vim /etc/cobbler/dhcp.template
#

Cobbler 无人值守介绍与自动部署批量安装

我们先来看下dhcp配置文件

Cobbler 无人值守介绍与自动部署批量安装

还是空的没有配置信息

②同步

systemctl restart cobblerd
#重启服务
cobbler sync
#数据同步

再来看dhcp配置文件

Cobbler 无人值守介绍与自动部署批量安装

有信息了

步骤六

①开启dhcp服务

systemctl start dhcpd
#开启服务

②建立cobbler yum源-导入系统

Cobbler 无人值守介绍与自动部署批量安装

这里我们也把centos6导入

Cobbler 无人值守介绍与自动部署批量安装

备注:它是放在了/var/www/目录下,同时生成了一个和系统同名的kickstart文件,

自带的kickstart文件是满足不了我们的需求的,所以我们使用自己的kickstart文件,之前生成过,直接拿来用。

步骤七

①编辑ks.cfg文件(前几篇提到过怎么创建改文件)

Cobbler 无人值守介绍与自动部署批量安装

②把ks.cfg文件放在/var/lib/cobbler/kickstarts/下

Cobbler 无人值守介绍与自动部署批量安装

③创建启动菜单

cobbler profile add –name=Centos-7.5-x86_64-Auto –distro=Centos-7.5-x86_64 –kickstart=/var/lib/cobbler/kickstarts/ks.cfg
#
cobbler profile add –name=Centos-6.9-x86_64-Auto –distro=Centos-6.9-x86_64 –kickstart=/var/lib/cobbler/kickstarts/ks6.cfg
#

Cobbler 无人值守介绍与自动部署批量安装

④查看启动文件default是不是有了我们创建的自定义启动项

cat /var/lib/tftpboot/pxelinux.cfg/default
#查看启动菜单

Cobbler 无人值守介绍与自动部署批量安装

备注:也可删除不需要的启动菜单

cobbler profile remove –name=Centos-6.9-x86_64

OK现在就可以用准备好的另一台主机测试

备注:确保 http tftp dhcp 服务已开启 防火墙以关闭 selinux以关闭

成功界面

Cobbler 无人值守介绍与自动部署批量安装

cobbler-web管理

1、首先安装包

yum install -y cobbler-web
#

2、访问

https://192.168.43.7/cobbler_web

默认账号:cobbler

默认密码:cobbler

Cobbler 无人值守介绍与自动部署批量安装

附带过程中出现的问题

问题一:出现如下提示:

Cobbler 无人值守介绍与自动部署批量安装

解决方案:http:改为https:访问 

问题二:安装新系统的时候,出现TFTP open timeout!

Cobbler 无人值守介绍与自动部署批量安装

解决方案:关闭防火墙

#systemctl stop firewalld.service

#iptables –L 

问题三:check环境检查的时在cobbler 候出现如下

Cobbler 无人值守介绍与自动部署批量安装

解决方案:这是ip分配错误的提示,检查配置文件IP分配段

每个人遇到的问题可能不一样,查看日志检查,tailf -10 /var/log/messages

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

栗子博客 软件 Cobbler 无人值守介绍与自动部署批量安装 https://www.lizi.tw/soft/9907.html

常见问题
  • 1、杰齐1.7仅适用于PHP5.2 2、需Zend支持 3、尽量使用宝塔面板 4、尽量使用Windows 系统,关关对Linux支持不太友好。
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

Cobbler 无人值守介绍与自动部署批量安装-海报

分享本文封面