1.1 cobbler简介

  Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等。

  Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。

  Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。

  Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。

  Cobbler官网http://cobbler.github.io

  在使用cobbler之前需要了解kickstart的使用: http://www.cnblogs.com/clsn/p/7833333.html

1.1.1 cobbler集成的服务

    PXE服务支持

    DHCP服务管理

    DNS服务管理(可选bind,dnsmasq)

    电源管理

    Kickstart服务支持

    YUM仓库管理

    TFTP(PXE启动时需要)

    Apache**(提供kickstart的安装源,并提供定制化的kickstart****配置)**

1.2 安装cobbler

1.2.1 环境说明

[root@Cobbler ~]# uname -r 3.10.0-693.el7.x86_64

[root@Cobbler ~]# getenforce Disabled

[root@Cobbler ~]# systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1)

[root@Cobbler ~]# hostname -I 10.0.0.202 172.16.1.202

yum__源说明:

1.2.2 使用yum安装cobbler

   说明:cobbler__是依赖与epel__源下载

1.2.3 cobbler语法检查前先启动http与cobbler

1.2.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.

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.5 解决当中的报错

命令集

systemctl start rsyncd systemctl enable rsyncd systemctl enable tftp.socket systemctl start tftp.socket systemctl restart cobblerd.service

sed -i.ori 's#192.168.1#172.16.1#g;22d;23d' /etc/cobbler/dhcp.template

cobbler sync

<p>
  <em><span style="text-decoration: underline;">详解</span></em>
</p>

<p>
  <em>解决1</em><em>、2</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>cp /etc/cobbler/<span style="color: #000000;">settings{,.ori}

sed -i 's/server: 127.0.0.1/server: 172.16.1.202/' /etc/cobbler/settings sed -i 's/next_server: 127.0.0.1/next_server: 172.16.1.202/' /etc/cobbler/settings

<p>
  <em>问题3</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>sed <span style="color: #800000;">'</span><span style="color: #800000;">s#yes#no#g</span><span style="color: #800000;">'</span> /etc/xinetd.d/tftp -i</pre>
  </div>
</div>

<p>
  <em>4</em><em>下载包所需的软件包</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> cobbler get-loaders</span>

[root@Cobbler ~]# ls /var/lib/cobbler/loaders COPYING.elilo elilo-ia64.efi menu.c32 yaboot COPYING.syslinux grub-x86_64.efi pxelinux.0 COPYING.yaboot grub-x86.efi README

<p>
  <em>5</em><em>启动rsync</em><em>服务</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> systemctl start rsyncd.service</span>

[root@Cobbler ~]# systemctl enable rsyncd.service

<p>
  <em>6 debian</em><em>相关无需修改</em>
</p>

<p>
  <em>7</em><em>、修改安装完成后的root</em><em>密码</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>openssl passwd -1 -salt <span style="color: #800000;">'</span><span style="color: #800000;">random-phrase-here</span><span style="color: #800000;">'</span> <span style="color: #800000;">'</span><span style="color: #800000;">your-password-here</span><span style="color: #800000;">'</span><span style="color: #000000;">

random-phrase-here 随机字符串 your-password-here 密码

<p>
  <em><span style="text-decoration: underline;">示例</span></em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> openssl passwd -1 -salt 'CLSN' '123456'</span>

$1$CLSN$LpJk4x1cplibx3q/O4O/K/

<p>
  <em>管理dhcp</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>sed -i <span style="color: #800000;">'</span><span style="color: #800000;">s/manage_dhcp: 0/manage_dhcp: 1/</span><span style="color: #800000;">'</span> /etc/cobbler/settings</pre>
  </div>
</div>

<p>
  <em><span style="text-decoration: underline;">防止重装</span></em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>sed -i <span style="color: #800000;">'</span><span style="color: #800000;">s/pxe_just_once: 0/pxe_just_once: 1/</span><span style="color: #800000;">'</span> /etc/cobbler/settings</pre>
  </div>
</div>

<p>
  <em><span style="text-decoration: underline;">修改dhcp</span></em><em><span style="text-decoration: underline;">模板</span></em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>sed -i.ori <span style="color: #800000;">'</span><span style="color: #800000;">s#192.168.1#172.16.1#g;22d;23d</span><span style="color: #800000;">'</span> /etc/cobbler/dhcp.template</pre>
  </div>
</div>

<p>
  cobbler组配置文件位置
</p>

<div>
  <div class="cnblogs_code">
    <pre>/etc/cobbler/settings</pre>
  </div>
</div>

<p>
  <strong>注意:修改完成之后要使用cobbler sync </strong><strong>进行同步,否则不生效。</strong>
</p>

<h3>
  <span id="126">1.2.6 修改之后</span>
</h3>

<p>
  <em>再次检查语法:</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> cobbler check</span>

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

<p>
  重启所有服务
</p>

<div>
  <div class="cnblogs_code">
    <pre><span style="color: #000000;">systemctl restart httpd.service

systemctl restart cobblerd.service systemctl restart dhcpd.service systemctl restart rsyncd.service systemctl restart tftp.socket

<p>
  <strong>到此cobbler</strong><strong>就安装完成,下面进行web</strong><strong>界面的操作。</strong>
</p>

<h2>
  <span id="13_cobblerweb">1.3 cobbler的web及界面操作</span>
</h2>

<p>
  浏览器访问<strong><em>https://10.0.0.202/cobbler_web</em></strong>
</p>

<p>
  &nbsp;&nbsp; <em>注意CentOS7</em><em>中cobbler</em><em>只支持https</em><em>访问。</em>
</p>

<p>
  <em>&nbsp;&nbsp; </em><em>账号密码默认均为</em><strong>cobbler</strong>
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171117046-397590980.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<h3>
  <span id="131">1.3.1 操作说明--导入镜像</span>
</h3>

<p>
  1)在虚拟机上添加上镜像
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171127546-900178910.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<p>
  2)挂载上镜像
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> mount /dev/cdrom  /mnt/</span>

mount: /dev/sr0 is write-protected, mounting read-only

[root@Cobbler ~]# df -h |grep mnt /dev/sr0 4.3G 4.3G 0 100% /mnt

<p>
  &nbsp;&nbsp; 3)进行导入镜像
</p>

<p>
  &nbsp;&nbsp; 选择<em>Import DVD</em> &nbsp;输入Prefix(文件前缀),Arch(版本),Breed(品牌),Path(要从什么地方导入)
</p>

<p>
  &nbsp;&nbsp; 在导入镜像的时候要注意路径,防止循环导入。
</p>

<p>
  &nbsp;&nbsp; 信息配置好后,点击run,即可进行导入。
</p>

<p align="center">
  &nbsp;<img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171154031-1223678363.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
</p>

<p>
  <em>导入过程使用rsync</em><em>进行导入,三个进程消失表示导入完毕</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler mnt]<span style="color: #008000;">#</span><span style="color: #008000;"> ps -ef |grep rsync</span>

root 12026 1 0 19:04 ? 00:00:00 /usr/bin/rsync –daemon –no-detach root 13554 11778 12 19:51 ? 00:00:06 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS7.4-x86_64 –progress root 13555 13554 0 19:51 ? 00:00:00 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS7.4-x86_64 –progress root 13556 13555 33 19:51 ? 00:00:17 rsync -a /mnt/ /var/www/cobbler/ks_mirror/CentOS7.4-x86_64 –progress root 13590 10759 0 19:52 pts/1 00:00:00 grep –color=auto rsync

<p>
  查看日志可以发现右running进程
</p>

<p>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 日志位于 <strong>Events</strong>
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171219140-820246395.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<p>
  <em>导入完成后生成的文件夹</em>
</p>

<div>
  <div class="cnblogs_code">
    <pre>[root@Cobbler ks_mirror]<span style="color: #008000;">#</span><span style="color: #008000;"> pwd</span>

/var/www/cobbler/ks_mirror

[root@Cobbler ks_mirror]# ls CentOS7.4-x86_64 config

<h3>
  <span id="132">1.3.2 创建一台空白虚拟机,进行测试网路安装</span>
</h3>

<p>
  注意:虚拟机的内存不能小于2G,网卡的配置要保证网络互通
</p>

<p>
  <strong>启动虚拟机</strong>
</p>

<p>
  <strong>&nbsp;&nbsp; </strong>启动虚拟机即可发现会有cobbler的选择界面
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171242656-398272156.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
</p>

<p>
  选择CentOS7.4即可进行安装,安装过程与光盘安装一致,这里就不在复述。
</p>

<h2>
  <span id="14">1.4 定制化安装操作系统</span>
</h2>

<h3>
  <span id="141">1.4.1 添加内核参数</span>
</h3>

<p>
  1)查看导入的镜像,点击edit
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171258015-1494072420.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<p>
  2)在内核参数中添加net.ifnames=0 biosdevname=0
</p>

<p>
  &nbsp;&nbsp; 能够让显示的网卡变为eth0 ,而不是CentOS7中的ens33
</p>

<p>
  &nbsp;&nbsp; 修改完成后点击保存
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171309874-60725189.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
</p>

<h3>
  <span id="142">1.4.2 查看镜像属性</span>
</h3>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171319609-343797442.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<h3>
  <span id="143_ks">1.4.3 编写ks文件</span>
</h3>

<p>
  1)创建新的ks文件
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171338593-1336390307.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
</p>

<p>
  2)添加ks文件,并配置文件名
</p>

<p>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 创建完成后点击Save进行保存
</p>

<p align="center">
  <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171346874-1039121760.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
</p>

<p>
  <em><span style="text-decoration: underline;">CentOS7 &nbsp;ks</span></em><em><span style="text-decoration: underline;">配置文件参考</span></em>
</p>

<div>
  <div class="cnblogs_code" onclick="cnblogs_code_show('7b3e062f-ee05-45e1-ab6e-16bbbd318202')">
    <img id="code_img_closed_7b3e062f-ee05-45e1-ab6e-16bbbd318202" class="code_img_closed" src="https://clsn.io/wp-content/uploads/2018/03/ContractedBlock-16.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" /><img id="code_img_opened_7b3e062f-ee05-45e1-ab6e-16bbbd318202" class="code_img_opened" style="display: none;" onclick="cnblogs_code_hide('7b3e062f-ee05-45e1-ab6e-16bbbd318202',event)" data-original="https://clsn.io/wp-content/uploads/2018/03/ExpandedBlockStart-16.gif" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" /></p> 
    
    <div id="cnblogs_code_open_7b3e062f-ee05-45e1-ab6e-16bbbd318202" class="cnblogs_code_hide">
      <pre><span style="color: #008080;"> 1</span> <span style="color: #008000;">#</span><span style="color: #008000;"> Cobbler for Kickstart Configurator for CentOS 7 by clsn</span>

2 install 3 url –url=$tree 4 text 5 lang en_US.UTF-8 6 keyboard us 7 zerombr 8 bootloader –location=mbr –driveorder=sda –append="crashkernel=auto rhgb quiet" 9 #Network information 10 $SNIPPET('network_config') 11 #network –bootproto=dhcp –device=eth0 –onboot=yes –noipv6 –hostname=CentOS7 12 timezone –utc Asia/Shanghai 13 authconfig –enableshadow –passalgo=sha512 14 rootpw –iscrypted $default_password_crypted 15 clearpart –all –initlabel 16 part /boot –fstype xfs –size 1024 17 part swap –size 1024 18 part / –fstype xfs –size 1 –grow 19 firstboot –disable 20 selinux –disabled 21 firewall –disabled 22 logging –level=info 23 reboot 24 25 %pre 26 $SNIPPET('log_ks_pre') 27 $SNIPPET('kickstart_start') 28 $SNIPPET('pre_install_network_config') 29 # Enable installation monitoring 30 $SNIPPET('pre_anamon') 31 %end 32 33 %packages 34 @^minimal 35 @compat-libraries 36 @core 37 @debugging 38 @development 39 bash-completion 40 chrony 41 dos2unix 42 kexec-tools 43 lrzsz 44 nmap 45 sysstat 46 telnet 47 tree 48 vim 49 wget 50 %end 51 52 %post 53 systemctl disable postfix.service 54 %end

    <p>
      <span class="cnblogs_code_collapse">View Code&nbsp; ks文件内容(centos7.x)</span></div> </div> 
      
      <h3>
        <span id="144">1.4.4 自定义安装系统</span>
      </h3>
      
      <p>
        1)选择systems 创建一个新的系统
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171448749-413659574.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
      </p>
      
      <p>
        2)定义系统信息
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171500702-1774899020.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
      </p>
      
      <p>
        3)配置全局网络信息
      </p>
      
      <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 主机名、网关、DNS
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171510515-1866830973.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
      </p>
      
      <p>
        4)配置网卡信息,eth0,eth1
      </p>
      
      <p>
        &nbsp;&nbsp; 需要注意,选择static静态,
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171519781-484237309.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
      </p>
      
      <p>
        &nbsp;&nbsp; <strong>以上的所有配置完成后,点击Save</strong><strong>进行保存</strong>
      </p>
      
      <p>
        <span style="background-color: #ffffff; color: #0000ff;"><strong><em>附录:</em></strong></span>
      </p>
      
      <p>
        &nbsp;&nbsp; VMware workstation中查看虚拟机mac地址的方法。在虚拟机设置中。
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171558437-2147316862.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
      </p>
      
      <p>
        <strong>&nbsp;cobbler web 界面</strong><strong>说明</strong>
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171610484-679767567.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
      </p>
      
      <h2>
        <span id="15">1.5 安装虚拟机</span>
      </h2>
      
      <h3>
        <span id="151">1.5.1 开启虚拟机</span>
      </h3>
      
      <p>
        如果之前的设置就显示安装进度
      </p>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171637515-1915678553.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
      </p>
      
      <h3>
        <span id="152">1.5.2 安装完成进行检查</span>
      </h3>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171645890-120797278.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />
      </p>
      
      <h2>
        <span id="16_cobbler">1.6 cobbler使用常见错误</span>
      </h2>
      
      <h3>
        <span id="161_cobbler_check">1.6.1 cobbler check报错</span>
      </h3>
      
      <div>
        <div class="cnblogs_code">
          <pre>[root@Cobbler ~]<span style="color: #008000;">#</span><span style="color: #008000;"> cobbler sync</span>

Traceback (most recent call last): File "/usr/bin/cobbler", line 36, in <module> sys.exit(app.main()) File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 662, in main rc = cli.run(sys.argv) File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 269, in run self.token = self.remote.login("", self.shared_secret) File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in call return self.__send(self.__name, args) File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request verbose=self.__verbose File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib64/python2.7/xmlrpclib.py", line 1306, in single_request return self.parse_response(response) File "/usr/lib64/python2.7/xmlrpclib.py", line 1482, in parse_response return u.close() File "/usr/lib64/python2.7/xmlrpclib.py", line 794, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 1: "<class ‘cobbler.cexceptions.CX’>:‘login failed’">

      <p>
        解决办法
      </p>
      
      <div>
        <div class="cnblogs_code">
          <pre><span style="color: #000000;">systemctl restart httpd.service

systemctl restart cobblerd.service cobbler check

      <h3>
        <span id="162_No_space_left_on_device">1.6.2 No space left on device</span>
      </h3>
      
      <p align="center">
        <img data-original="https://images2017.cnblogs.com/blog/1190037/201711/1190037-20171115171739296-1920171628.png" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" />&nbsp;
      </p>
      
      <p>
        &nbsp;&nbsp; 出现这个错误的原因是虚拟机的内存不足2G,
      </p>
      
      <p>
        &nbsp;&nbsp; 将内存调为2G即可(这个错误只会出现在CentOS7.3之上)
      </p>
      
      <h2>
        <span id="17_cobbler_CentOS6x_ks"><span style="color: #99cc00;">1.7 附录cobbler_CentOS6.x_ks配置文件</span></span>
      </h2>
      
      <div>
        <div class="cnblogs_code" onclick="cnblogs_code_show('ef9ba030-45ea-46b1-b5c0-4642b2fbd94e')">
          <img id="code_img_closed_ef9ba030-45ea-46b1-b5c0-4642b2fbd94e" class="code_img_closed" src="https://clsn.io/wp-content/uploads/2018/03/ContractedBlock-16.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" /><img id="code_img_opened_ef9ba030-45ea-46b1-b5c0-4642b2fbd94e" class="code_img_opened" style="display: none;" onclick="cnblogs_code_hide('ef9ba030-45ea-46b1-b5c0-4642b2fbd94e',event)" data-original="https://clsn.io/wp-content/uploads/2018/03/ExpandedBlockStart-16.gif" src="/wp-content/themes/clsn-003/img/blank.gif" alt="使用cobbler批量安装操作系统(基于Centos7.x )" alt="" /></p> 
          
          <div id="cnblogs_code_open_ef9ba030-45ea-46b1-b5c0-4642b2fbd94e" class="cnblogs_code_hide">
            <pre><span style="color: #008000;">#</span><span style="color: #008000;"> Cobbler for Kickstart Configurator for CentOS 6  by clsn</span>

install url –url=$tree text lang en_US.UTF-8 keyboard us zerombr bootloader –location=mbr –driveorder=sda –append="crashkernel=auto rhgb quiet" $SNIPPET('network_config') timezone –utc Asia/Shanghai authconfig –enableshadow –passalgo=sha512 rootpw iscrypted $default_password_crypted clearpart –all –initlabel part /boot –fstype=ext4 –asprimary –size=200 part swap –size=1024 part / –fstype=ext4 –grow –asprimary –size=200 firstboot disable selinux disabled firewall disabled logging –level=info reboot

%pre $SNIPPET('log_ks_pre') $SNIPPET('kickstart_start') $SNIPPET('pre_install_network_config') # Enable installation monitoring $SNIPPET('pre_anamon') %end

%packages @base @compat-libraries @debugging @development tree nmap sysstat lrzsz dos2unix telnet %end

%post –nochroot $SNIPPET('log_ks_post_nochroot') %end

%post $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

          <p>
            <span class="cnblogs_code_collapse">View ks文件参考&nbsp; centos6.x</span></div> </div> 
            
            <h2>
              <span id="18">1.8 参考文档</span>
            </h2>
            
            <p>
                http://blog.oldboyedu.com/autoinstall-cobbler/
            </p>
            
            <p>
                http://www.zyops.com/autoinstall-cobbler
            </p>
            
            <div id="toc_container" class="toc_white have_bullets">
              <ul class="toc_list">
                <li>
                  <a href="#11_cobbler">1.1 cobbler简介</a><ul>
                    <li>
                      <a href="#111_cobbler">1.1.1 cobbler集成的服务</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#12_cobbler">1.2 安装cobbler</a><ul>
                    <li>
                      <a href="#121">1.2.1 环境说明</a>
                    </li>
                    <li>
                      <a href="#122_yumcobbler">1.2.2 使用yum安装cobbler</a>
                    </li>
                    <li>
                      <a href="#123_cobblerhttpcobbler">1.2.3 cobbler语法检查前先启动http与cobbler</a>
                    </li>
                    <li>
                      <a href="#124">1.2.4 进行语法检查</a>
                    </li>
                    <li>
                      <a href="#125">1.2.5 解决当中的报错</a>
                    </li>
                    <li>
                      <a href="#126">1.2.6 修改之后</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#13_cobblerweb">1.3 cobbler的web及界面操作</a><ul>
                    <li>
                      <a href="#131">1.3.1 操作说明--导入镜像</a>
                    </li>
                    <li>
                      <a href="#132">1.3.2 创建一台空白虚拟机,进行测试网路安装</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#14">1.4 定制化安装操作系统</a><ul>
                    <li>
                      <a href="#141">1.4.1 添加内核参数</a>
                    </li>
                    <li>
                      <a href="#142">1.4.2 查看镜像属性</a>
                    </li>
                    <li>
                      <a href="#143_ks">1.4.3 编写ks文件</a>
                    </li>
                    <li>
                      <a href="#144">1.4.4 自定义安装系统</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#15">1.5 安装虚拟机</a><ul>
                    <li>
                      <a href="#151">1.5.1 开启虚拟机</a>
                    </li>
                    <li>
                      <a href="#152">1.5.2 安装完成进行检查</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#16_cobbler">1.6 cobbler使用常见错误</a><ul>
                    <li>
                      <a href="#161_cobbler_check">1.6.1 cobbler check报错</a>
                    </li>
                    <li>
                      <a href="#162_No_space_left_on_device">1.6.2 No space left on device</a>
                    </li>
                  </ul>
                </li>
                
                <li>
                  <a href="#17_cobbler_CentOS6x_ks">1.7 附录cobbler_CentOS6.x_ks配置文件</a>
                </li>
                <li>
                  <a href="#18">1.8 参考文档</a>
                </li>
              </ul>
            </div>