前言:前一篇提到了如何在CentOS7下利用Cobbler来安装部署CentOS,没接触过的朋友可以参考我上一篇的文章:,现在又测试了下利用cobbler2.8.0部署esxi5.5,参考了网上的一些资料,但与我实际操作中碰到的有些差异,所以特意记录下来。
1、查看cobbler的版本
[root@cobbler ~]# cobbler --version
Cobbler 2.8.0
source: ?, ?
build time: Tue Jan 31 23:25:14 2017
[root@cobbler ~]# cat /etc/RedHat-release
CentOS Linux release 7.3.1611 (Core)
2、挂载并导入ESXI5.5的数据
[root@cobbler ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@cobbler ~]# cobbler import --path=/mnt --name=EXSI5.5 --arch=x86_64
task started: 2017-03-21_143016_import
task started (id=Media import, time=Tue Mar 21 14:30:16 2017)
# 以下为提示信息,最开始看到的时候吓我一跳
Found a candidate signature: breed=vmware, version=esxi51
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:
Found a candidate signature: breed=vmware, version=esxi60
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:
Found a candidate signature: breed=vmware, version=esxi5
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:
Found a candidate signature: breed=vmware, version=esxi55
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/s.v00: gzip compressed data, was "vmvisor-sys.tar.vtar", from Unix, last modified: Thu Sep 19 14:39:27 2013
received on stderr:
Found a matching signature: breed=vmware, version=esxi55
Adding distros from path /var/www/cobbler/ks_mirror/EXSI5.5-x86_64:
running: /usr/bin/file /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/tools.t00
received on stdout: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64/tools.t00: gzip compressed data, from Unix, last modified: Thu Sep 19 14:38:11 2013
received on stderr:
creating new distro: EXSI5.5-x86_64
trying symlink: /var/www/cobbler/ks_mirror/EXSI5.5-x86_64 -> /var/www/cobbler/links/EXSI5.5-x86_64
creating new profile: EXSI5.5-x86_64
associating repos
*** TASK COMPLETE ***
[root@cobbler ~]# echo $?
0
说明:以上的输出结果可知,导入没有问题
3、编辑kickstart文件
[root@cobbler ~]# cd /var/lib/cobbler/kickstarts/
[root@cobbler kickstarts]# vim ESXI55.cfg
# set for install esxi55
vmaccepteula
# 注意如果密码长度小于7位,安装的时候会有报错的(可惜忘记截图了)
rootpw redhat123456
clearpart --firstdisk --overwritevmfs
install --firstdisk --overwritevmfs
# 注意网卡名称为vmnic0
network --bootproto=dhcp --device=vmnic0
reboot --noeject
[root@cobbler kickstarts]# ll
total 64
-rw-r--r-- 1 root root 1254 Mar 20 15:32 CentOS-6.7-x86_64.cfg
-rw-r--r-- 1 root root 1301 Mar 20 12:23 CentOS-7.3-x86_64.cfg
-rw-r--r-- 1 root root 115 Nov 17 03:09 default.ks
-rw-r--r-- 1 root root 22 Nov 17 03:09 esxi4-ks.cfg
-rw-r--r-- 1 root root 184 Mar 21 14:44 ESXI55.cfg
-rw-r--r-- 1 root root 22 Nov 17 03:09 esxi5-ks.cfg
drwxr-xr-x 2 root root 56 Mar 20 10:39 install_profiles
-rw-r--r-- 1 root root 1424 Nov 17 03:09 legacy.ks
-rw-r--r-- 1 root root 292 Nov 17 03:09 pxerescue.ks
-rw-r--r-- 1 root root 2916 Nov 17 03:09 sample_autoyast.xml
-rw-r--r-- 1 root root 1825 Nov 17 03:09 sample_end.ks
-rw-r--r-- 1 root root 0 Nov 17 03:09 sample_esx4.ks
-rw-r--r-- 1 root root 324 Nov 17 03:09 sample_esxi4.ks
-rw-r--r-- 1 root root 386 Nov 17 03:09 sample_esxi5.ks
-rw-r--r-- 1 root root 1784 Nov 17 03:09 sample.ks
-rw-r--r-- 1 root root 3419 Nov 17 03:09 sample_old.seed
-rw-r--r-- 1 root root 5879 Nov 17 03:09 sample.seed
说明:可以参考sample_esxi5.ks文件进行编辑
[root@cobbler kickstarts]# cobbler list
distros:
CentOS-6.7-x86_64
CentOS-7.3-x86_64
EXSI5.5-x86_64
profiles:
CentOS-6.7-x86_64
CentOS-7.3-x86_64
EXSI5.5-x86_64
systems:
cobbler2
repos:
images:
mgmtclasses:
packages:
files:
4、查看cobbler profile