1、安装epelyum源

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

2、安装cobbler和依赖

# yum -y install cobbler cobbler-web dnsmasq syslinux pykickstart bind rsync

3、启动服务

# systemctl start httpd
# systemctl start cobblerd
# systemctl start tftp.service


4、生产密码 

#openssl passwd -1 -salt 'fajlfjal' 'cobbler'
$1$fajlfjal$UdbS4N.XbTitCc5Pa0bvz.


5、配置cobbler

/etc/cobbler/settings:
default_password_crypted: "$1$fajlfjal$UdbS4N.XbTitCc5Pa0bvz."
manage_dhcp: 1
manage_dns: 1
manage_rsync: 1
pxe_just_once: 1
next_server: 192.168.0.5
server: 192.168.0.5


5、配置cobbler的DHCP模版

#cat /etc/cobbler/dhcp.template
subnet 192.168.56.0 netmask 255.255.255.0 {
     option routers             192.168.56.101;
     option domain-name-servers 192.168.56.101;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.56.200 192.168.56.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
            filename "pxelinux.0";
     }
}

7、重启cobbler

# systemctl restart cobblerd


8、检查下会有示需要什么,按要去安装或修改配置即可

# cobbler check 

CentOS7安装Cobbler+ESXI6.0_第1张图片

修改好了后sync同步下

# cobbler sync


9、挂载、导入镜像

# mount -o loop -t iso9660 VMware-VMvisor-Installer-6.0.0.update01-3029758.x86_64.iso /media
# cobbler import --path=/media/ --name=esxi-6.0 --arch=x86_64

10、配置安装镜像的ks文件

查看详细信息,看看用的那个KS

cobbler profile report --name=esxi-6.0-x86_64

CentOS7安装Cobbler+ESXI6.0_第2张图片

修改下KS如下

#
# Sample scripted installation file
# for ESXi 6
#
vmaccepteula
reboot --noeject
rootpw --iscrypted $default_password_crypted
install --firstdisk --overwritevmfs
clearpart --firstdisk --overwritevmfs
#$SNIPPET('network_config') //注释
#network --bootproto=dhcp //注释
%pre --interpreter=busybox
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
%post --interpreter=busybox
$SNIPPET('kickstart_done')
r=busybox
$SNIPPET('kickstart_done')

11、cobbler sync同步下,开始安装

CentOS7安装Cobbler+ESXI6.0_第3张图片