#####################################################
##如有转载,请务必保留本文链接及版权信息
##欢迎广大运维同仁一起交流linux/unix网站运维技术!
##QQ:335623998
##E-mail:335623998@qq.com
##博客: http://dreamway.blog.51cto.com/
##weibo:http://weibo.com/zhaixiangpan
#####################################################

《Cobbler部署指南》系列

1、《Cobbler部署指南之安装篇》http://dreamway.blog.51cto.com/blog/1281816/1166589

2、《Cobbler部署指南之配置管理篇[上文]》http://dreamway.blog.51cto.com/blog/1281816/1166921

3、《Cobbler部署指南之配置管理篇[下文]》http://dreamway.blog.51cto.com/blog/1281816/1166932

4、《Cobbler部署指南之yum仓库配置管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166936

5、《Cobbler部署指南之Cobbler安装操作系统篇》http://dreamway.blog.51cto.com/blog/1281816/1166947

6、《Cobbler部署指南之安装虚拟化Xen系统篇》http://dreamway.blog.51cto.com/blog/1281816/1166950

7、《Cobbler部署指南之电源管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166957

8、《Cobbler部署指南之FAQ处理篇》http://dreamway.blog.51cto.com/blog/1281816/1167078

七、Cobbler安装操作系统

7.1 安装完系统后默认的密码是啥呢?

这个密码 $default_password_crypted 就是步骤3.6使用openssl passwd -1 生成的密码

grep rootpw /var/lib/cobbler/kickstarts/sample.ks

rootpw --iscrypted $default_password_crypted

7.2 PXE菜单文件

默认菜单文件内容

cat /tftpboot/pxelinux.cfg/default

DEFAULT menu

PROMPT 0

MENU TITLE Hexun Automation Install System

TIMEOUT 150

TOTALTIMEOUT 6000

ONTIMEOUT local

LABEL local

MENU LABEL (local)

MENU DEFAULT

LOCALBOOT -1

LABEL centos5.8-x86_64

kernel /images/centos5.8-x86_64/vmlinuz

MENU LABEL centos5.8-x86_64

append initrd=/images/centos5.8-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://172.17.10.14/cblr/svc/op/

ks/profile/centos5.8-x86_64

ipappend 2

指定系统的菜单文件内容

cat /tftpboot/pxelinux.cfg/01-00-19-b9-e5-34-fe

default linux

prompt 0

timeout 1

label linux

kernel /images/centos5.8-x86_64/vmlinuz

ipappend 2

append initrd=/images/centos5.8-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://172.17.10.14/cblr/svc/op/ks/system/host-188116

7.3 安装系统

将需要安装系统的服务器网卡启用PXE,启动服务器从PXE引导

默认从本地硬盘引导,可以修改,建议还是保持此默认。

选择安装系统centos5.8-x86_64即可自动安装系统

Tab键,可以对启动项参数进行编辑

安装源数据说明:

系统centos5.8-x86_64的安装系统数据源,其他系统同理

链接

https://url/cblr/links/centos5.8-x86_64/

目录

/var/www/cobbler/links/centos5.8-x86_64/

是一个链接目录,实际位置如下

ll links/

total 0

lrwxrwxrwx 1 root root 43 Mar 12 13:41 centos5.8-x86_64 -> /var/www/cobbler/ks_mirror/centos5.8-x86_64

7.4 使用Koan重装系统

koan是cobbler的一个辅助工具,koan是kickstart-over-a-network的缩写安装在客户端的使用,koan配合cobbler实现快速重装linux。

koan 在Fedora, Red Hat Enterprise Linux, 和 CentOS工作正常,其他Linux版本应该也不错

koan的相关脚本在此目录内/usr/lib/python2.4/site-packages/koan/

通过EPEL安装的koan版本为koan-2.2.3-2.el5,使用中报错较多,此版本比较稳定koan-1.6.6-1.el5,下载链接ftp://rpmfind.net/linux/epel/5/i386/koan-1.6.6-1.el5.noarch.rpm

关于Koan更多内容见https://github.com/cobbler/cobbler/wiki/Koan

7.4.1 安装koan

在重装的机器上安装koan

rpm  -ivh koan-1.6.6-1.el5.noarch.rpm

7.4.2 列出远程cobbler上的系统版本对象

koan --server=172.17.10.14 --list=profiles

- looking for Cobbler at http://172.17.10.14:80/cobbler_api

centos5.8-xen-x86_64

centos6.4-x86_64

centos5.8-x86_64

centos6.3-x86_64

koan --server=172.17.10.14 --list=systems

- looking for Cobbler at http://172.17.10.14/cobbler_api

host-188116

koan --server=172.17.10.14 --list=images

7.4.3 学习更多关于远程Cobbler对象信息

koan --server=172.17.10.14 --display --profile=centos5.8-x86_64

- looking for Cobbler at http://172.17.10.14:80/cobbler_api

- reading URL: http://172.17.10.14/cblr/svc/op/ks/profile/centos5.8-x86_64

install_tree: http://172.17.10.14/cblr/links/centos5.8-x86_64

name  : centos5.8-x86_64

distro  : centos5.8-x86_64

kickstart  : http://172.17.10.14/cblr/svc/op/ks/profile/centos5.8-x86_64

ks_meta  : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64

install_tree  : http://172.17.10.14/cblr/links/centos5.8-x86_64

kernel  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/vmlinuz

initrd  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/initrd.img

kernel_options  : ks=http://172.17.10.14/cblr/svc/op/ks/profile/centos5.8-x86_64 ksdevice=link kssendmac lang= text

repos  : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates

virt_ram  : 512

virt_disk_driver  : raw

virt_type  : qemu

virt_path  :

virt_auto_boot  : 1

koan --server=172.17.10.14 --display --system=host-188116

- looking for Cobbler at http://172.17.10.14/cobbler_api

- reading URL: http://172.17.10.14/cblr/svc/op/ks/system/host-188116

install_tree: http://172.17.10.14/cblr/links/centos5.8-x86_64

name  : host-188116

distro  : centos5.8-x86_64

profile  : centos5.8-x86_64

kickstart  : http://172.17.10.14/cblr/svc/op/ks/system/host-188116

ks_meta  : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64

install_tree  : http://172.17.10.14/cblr/links/centos5.8-x86_64

kernel  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/vmlinuz

initrd  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/initrd.img

kernel_options  : ks=http://172.17.10.14/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac lang= text

repos  : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates

virt_ram  : 512

virt_type  : qemu

virt_path  :

[root@host-d-116 ~]# koan --server=172.17.10.14 --display --system=host-188116

- looking for Cobbler at http://172.17.10.14/cobbler_api

- reading URL: http://172.17.10.14/cblr/svc/op/ks/system/host-188116

install_tree: http://172.17.10.14/cblr/links/centos5.8-x86_64

name  : host-188116

distro  : centos5.8-x86_64

profile  : centos5.8-x86_64

kickstart  : http://172.17.10.14/cblr/svc/op/ks/system/host-188116

ks_meta  : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64

install_tree  : http://172.17.10.14/cblr/links/centos5.8-x86_64

kernel  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/vmlinuz

initrd  : /var/www/cobbler/ks_mirror/centos5.8-x86_64/images/pxeboot/initrd.img

kernel_options  : ks=http://172.17.10.14/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac lang= text

repos  : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates

virt_ram  : 512

virt_type  : qemu

virt_path  :

koan --server=172.17.10.14 --display --image=name

7.4.4 重新安装客户端系统

koan -r  --server=172.17.10.14  --profile=centos5.8-x86_64

- looking for Cobbler at http://172.17.10.14:80/cobbler_api

- reading URL: http://172.17.10.14/cblr/svc/op/ks/profile/centos5.8-x86_64

install_tree: http://172.17.10.14/cblr/links/centos5.8-x86_64

downloading initrd initrd.img to /boot/initrd.img_koan

url=http://172.17.10.14/cobbler/images/centos5.8-x86_64/initrd.img

- reading URL: http://172.17.10.14/cobbler/images/centos5.8-x86_64/initrd.img

downloading kernel vmlinuz to /boot/vmlinuz_koan

url=http://172.17.10.14/cobbler/images/centos5.8-x86_64/vmlinuz

- reading URL: http://172.17.10.14/cobbler/images/centos5.8-x86_64/vmlinuz

- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz_koan', '--initrd', '/boot/initrd.img_koan', '--args', '"ks=http://172.17.10.14/cblr/svc/op/ks/profile/centos5.8-x86_64 ksdevice=link kssendmac lang= text "', '--copy-default', '--make-default', '--title=kick1364289618']

- reboot to apply changes

注意:输入此命令重启后,不能再中止重装,重启后自动进入pxe装机。

reboot

执行reboot命令重启服务器后,客户端服务器会自动重新安装操作系统,无需人工干预

7.4.5 重新安装指定客户机系统

步骤3.11已经添加指定客户机配置,在这里使用配置为指定的服务器安装操作系统

[root@host-d-116 ~]# koan -r  --server=172.17.10.14  --system=host-188116

- looking for Cobbler at http://172.17.10.14/cobbler_api

- reading URL: http://172.17.10.14/cblr/svc/op/ks/system/host-188116

install_tree: http://172.17.10.14/cblr/links/centos5.8-x86_64

downloading initrd initrd.img to /boot/initrd.img

url=http://172.17.10.14/cobbler/images/centos5.8-x86_64/initrd.img

- reading URL: http://172.17.10.14/cobbler/images/centos5.8-x86_64/initrd.img

downloading kernel vmlinuz to /boot/vmlinuz

url=http://172.17.10.14/cobbler/images/centos5.8-x86_64/vmlinuz

- reading URL: http://172.17.10.14/cobbler/images/centos5.8-x86_64/vmlinuz

- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz', '--initrd', '/boot/initrd.img', '--args', '"ks=http://172.17.10.14/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac lang= text "', '--copy-default', '--make-default', '--title= kick1364390697']

- reboot to apply changes

[root@host-d-116 ~]# reboot

系统重启看到kick1364390697与上面命令生成的相同,重装过程同上

请看《Cobbler部署指南》系列续文

《Cobbler部署指南》系列文档下载:http://down.51cto.com/data/745895

Cobbler部署指南之Cobbler安装操作系统篇相关推荐

  1. Cobbler部署之FAQ处理

    Cobbler报错处理 通过cobbler check检查出现的报错 红色标注为报错关键信息 9.1 报错一 # cobbler check httpd does not appear to be r ...

  2. Windows Server 2008 R2 Hyper-V 故障转移群集部署指南

    Windows Server 2008 R2 Hyper-V 故障转移群集部署指南 1.安装2台 Windows Server 2008 R2服务器: 2.并配置计算机名称和IP地址; 3.将2台服务 ...

  3. cobbler命令_使用Cobbler批量部署Linux和Windows:Windows系统批量安装(三)

    说明:时不时会有读者就遇到的一些问题留言或者私信询问解决方法,但本人对 Desktop运维.PE镜像等并不熟悉了解,这篇文章是我曾经一时出于工作需要而进行的研究,因此很多问题我也不了解,故而无法解答, ...

  4. kvm cobbler无人值守批量安装操作系统

    kvm cobbler无人值守批量安装操作系统 cobbler:一个自动网络安装系统的工具,集成PEX.dhcp.dns.tftpd.sync等服务.可以供大家管理安装操作系统 kvm:Linux系统 ...

  5. Cobbler实现自动化安装操作系统

    一.cobbler简介 cobbler是实现自动化安装操作系统的工具.它解决了PXE安装时的弊端(只能实现单一操作系统的安装).实际上,cobbler是对PXE二次封装可实现多版本,多环境操作系统安装 ...

  6. cobbler集成服务器批量安装操作系统(无人值守)

    cobbler集成服务器批量安装操作系统 yum install epel-release -y #需要安装的epel源 yum install cobbler -y #安装cobbler,同时安装依 ...

  7. 自动化运维之kickstart自动化部署安装操作系统

    第1章 简介 1.1 PXE简介 q  PXE是预启动执行环境,全名是Pre-boot Execution Environment q  通过网络接口启动计算机,不需要依赖本地存储设备或本地已安装的操 ...

  8. kickstart自动化系统安装_自动化运维之kickstart自动化部署安装操作系统

    第1章 简介 1.1 PXE简介 qPXE是预启动执行环境,全名是Pre-boot Execution Environment q通过网络接口启动计算机,不需要依赖本地存储设备或本地已安装的操作系统 ...

  9. esxi时区设置 +8_ESXI安装OpenWRT amp; LEDE软路由部署指南(附镜像下载)

    OpenWrt 是嵌入式的 Linux 路由器固件,OpenWrt在稳定运行的同时提供了强大的扩展能力,用户可以完全的定制属于自己的路由系统,满足不一样的个性化需求,本文讲解如何使用ESXI安装Ope ...

最新文章

  1. 排序算法---快速排序(java版)
  2. 首次使用计算机鼠标键盘不能用,解决方案:如何解决无法使用计算机鼠标和键盘的问题?如果启动后无法使用鼠标和键盘该怎么办?...
  3. linux第一季运维001
  4. SAP Spartacus的pagination$ -默认的分页设置10
  5. GMF学习系列(二) 一些知识点(续2)
  6. C++vector容器-互换容器
  7. 区间合并(信息学奥赛一本通-T1236)
  8. C++案例 利用基本语法实现程序
  9. 《重构》-重新组织函数
  10. 数据库---事务(一)
  11. 语音识别结合应用场景 各位大咖也有一些精彩论点
  12. 毕业三年,同学基本都辞职了,大部分人看完很有同感~
  13. svn 服务器修改密码,用户自行修改svn密码的简单服务
  14. k2p—b1版本刷固件遇到的问题
  15. Linux环境下安装yafu
  16. 美国与中国互联网电视发展状况比较分析研究
  17. 如何设置透明FLASH
  18. 用c++编程六子棋游戏
  19. 中秋之际,我想给月亮做一个智能化改造
  20. 自动化运维工具ansible(安装与模块介绍)

热门文章

  1. iOS RunLoop简介
  2. iOS彩票项目--第三天,搭建竞技场和发现,搭建幸运选号和我的彩票界面
  3. hadoop2.610集群配置(包含HA和Hbase )
  4. 一步一步搭架子(DM层与Service层)
  5. 在IntelliJ IDEA中创建Web项目
  6. 抽象方法和接口的区别
  7. 【GoLang】GoLang GOPATH 工程管理 最佳实践
  8. Introduction to random forests
  9. 第10章 接口、继承与多态----抽象类和接口
  10. APP用户的生命周期价值(LTV)